ajax

asynchronous file upload with java servlet

Here's I want to do, I want to upload a file that will be processed by a servlet. I would use Apache Commons - File Upload to handle the file to be uploaded. I've seen the gmail-like AJAX file upload, where there would be a hidden iframe that would later be populated with a javascript to stop showing the upload image or displaying a mes...

ASP.Net MVC AJAX link not working

I have this link, in an effort to implement AJAX log on, on my page: <%= Ajax.ActionLink("Log On", "LogOn", "Account", new AjaxOptions { UpdateTargetId = "lll", Confirm = "blah"}) %> There's a div with id lll nearby. When I click the link, I get the blah confirmation (just added for debugging purposes, the behavior without it ...

Should I bring HTML snippets or JSON?

Please note: this is not exactly same as this question. Although it looks like that, I have some very specific requirements. In my application, I have two panels to update with a single AJAX request. Currently, I am sending JSON, and constructing two DOMs in JS and appending them in corresponding places. This is becoming difficult to m...

How do you close a jQuery Simplemodal?

I want to close a Simplemodal window from a JavaScript function that gets called automatically after a form is submitted and the results recived (AJAX), using ASP.Net MVC. How do I close a jQuery Simplemodal? I've opened it this way: $("#popup").modal() ...

Nested UpdatePanel Behavior

I am using a Wizard control in an UpdatePanel. Some of the Wizard Steps have UpdatePanels nested inside. Both the outer and inner UpdatePanels have their own Trigger collection. All of the events fire as intended. However, the triggers for the outer UpdatePanel do not set off the UpdateProgress control. The inner ones all do. I'm...

jquery to convert strings to json to send to my webservice?

Hi there, Trying to figure out how to convert how to covert 5 variables i have in javascript (strings) to a json for sending along to my ajax function here is my ajax funtion, sill relatively new to this but i believe this should work .. but i need to convert all my strings to a json - don't i? I believe there are alternative ways of ...

calling a webservice with jquery that accepts five STRING params?

Hi there, is it possible to call a webservice that accepts 5 string parameters without sending via json? (is this recommended) I have created a webservice with a method that accepts 5 string params.. and i have my jquery $.ajax({ type: "POST", url: "Service.aspx/CreateClient", ...

Checking Jquery ajax load success

I've been using this to load another page: http:||docs.jquery.com/Ajax/load and just using their example, $("#links").load("/Main_Page #jq-p-Getting-Started li"); However I want to run a function when the load is successful, and a different one if it fails, unfortunately the description on the callback says: The function called when...

jQuery Ajax JavaScript Execution

Hello everyone, I have jQuery ajax requesting a page that returns html with <script> tags inside that html, I have the dataType option set to "html" so that I get the JS inside the <script> tags executed, this works fine but the problem that it takes the browser from 2-3 seconds to evaluate the returned JS after the ajax response, why i...

Calling asp.net webmethod with params from jquery errors

Hi there, I managed to setup a simple webmethod which i called from jquery and sure enough it returns ... then i added parameters on the method and added the params to jquery but it errors with Message":"Invalid JSON primitive: one.","StackTrace":" my signature on my webmethod is like so [WebMethod] public static str...

Passing js object as json to jquery?

I have the following but it's not working, I read somewhere on the stackoverflow that it works like this but I can't seem to get it to work.. it errors... am I doing something wrong? If I do pass data like this - it works -- so I know my service is working //THIS WORKS data: "{one : 'test',two: 'test2' }" // BUT SETTING UP OBJECT do...

IE loses css styles after table rows are appended with javascript

I have a problem where i am doing an ajax fetch of some table rows which i use to replace a table's body. The problem is that sometimes IE(6/7) decides to forget about all page styles after such an append. (that is to say, it reverts to using styles in css includes at the top of the page, but not styles defined on the page itself) I h...

recommended return type for a webservice that doesn't return anything (called with jquery)

Hi there, I have a web service with some methods, they technically don't do much on the client.. i am calling it by jquery/ajax What is the recommended return type, i would normally return JSON ... but in the case that it doens't return anything .. do i return a boolean? i.e. true = succesful ... and false = error ?? Any ideas? ...

Jquery Ajax animation?

Hi there, I have a ajax jquery petition ... is there a standard way of displaying a nice animation while it completes. Anybody have any info? Its just that petition is taking around 15 seconds when there is an error in the server... so i would like to display an animation in case of this situation... I am not necessarily talking abou...

jQuery Cross domain ajax calls and Internet Explorer

The following code works fine in Firefox but in IE the link is never called, the exception is called with a rather generic [Object Error] var GoalID = "e13e68a8-ae18-49f1-9d2f-e052a63fac51"; try { $.ajax({ type: "GET", url: "http://www.externallink.co.uk/GoalAccessed.aspx?id=" + GoalID, dataType: "script" }); }...

JQuery pass more parameters into callback

Hi all, Is there a way to pass more data into a callback function in Jquery? I have two functionsm and I want the callback to the $.post, for example, to pass in both the resulting data of the AJAX call, as well as a few custom arguments function clicked() { var myDiv = $("#my-div"); // ERROR: Says data not defined $.post("someurl.php...

asp.net with javascript page refresh

Hi all I have an ASP.Net appl composed by three pages; page1, page2 and page3 The execution starts on page one. Page1 calls Page2, but page1 has to be visible still, so user can still work on that page. When Page2 closes, a java script function calls Page3, so all the cleaning is done on page 3. When page 3 completes its task, the window...

Jquery: ajaxSend & ajaxStop events not working?

Hi ... can't seem to get the ajaxSend and Stop to work... These are global variables no? .. but i should be able to use like this... but i never get an alert?? I wanted to use these events to display a ajax animation.. although in my code i wish to position the ajax animation depending what i am doing an what element it is.. ...

When to use Ajax vs Json for Javascript events?

I'm not so familiar with Ajax but I keep hearing Json mentioned as some kind of competing option. Is there a rule for when to use one versus the other? I'd like to process Javascript events in my app and update the front-end dynamically from the app but I'm not sure whether I need to use Ajax or Json for this. ...

Fetching an image and associated metadata with an AJAX request

I have a somewhat expensive server-side operation that produces an image and some associated text metadata about that image. My web page will display both. The image and its data are fetched with AJAX calls. On the server side, it is possible to produce the image and the metadata at the same time. How can I transfer (and display) both t...