ajax

Can an Ajax call complete before the DOM is loaded?

I am grabbing data through a jQuery Ajax call, and displaying it on the page. I need to wait for both the DOM to load and for the Ajax call to complete before I can use the data to display it on the page. Can an Ajax call ever complete before the DOM has loaded? I'm just trying to determine where I need to put my method that will mani...

ajax upload cannot process JSON response or gives download popup

I'm using the AJAX plugin from Andris Valums: AJAX Upload ( http://valums.com/ajax-upload/ ) Copyright (c) Andris Valums It works great, except for the fact that I cannot send proper JSON as a response. I'm setting the headers to 'Content-Type', 'application/json' before sending the JSON-encoded response, and in the plugin I'm sayi...

Is there a book that discusses OOP javascript to build something like gmail's frontend?

I want a book that gives a detailed account of building a rich front end interface like gmail. is there one around? There are books that go over concepts, but I need something to put it all together. Guess I am looking for more of a 'solutions' approach, rather than a reference type book. ...

Fiddler investigation of RPC (extjs client-library)

I captured a log at a clients site using: Fiddler (v2.2.9.1) Session Archive. See http://www.fiddler2.com and have some requests that seem wierd to me: Request Count: 1 Bytes Sent: 1,525 Bytes Received: 804 ACTUAL PERFORMANCE -------------- ClientConnected: 15:40:54:6546 ClientDoneRequest: 15:41:00:1390 Gateway Determination:...

Content pulled in via jQuery AJAX is not associating with previous functions

I'm using the jquery .load() function to pull in data to populate a div with. The content I'm pulling in has CSS selectors that should match up with jQuery click functions I've written. However, when I load in the data, although the correct CSS selectors are there, when I click on areas that should invoke a response from jQuery, nothing ...

how to send data to server with the same TCP connection using ajax or JS trick

Hi, I know how to keep a connection indifinetely open server side to stream continuously data to javascript. BUT I do not know how to send data reusing the same TCP from browser to server. so there is not the 3 way handshake and only 2 tcp packets. I know it is possible but I do not how to do it : use xmlhttprequest? or script tag ajax ...

Use AJAX to watch SQL database for changes.

I have a column in my database that will be updated randomly. Whenever that column is updated I need to refresh content on my page. How can I use AJAX + jQuery to perform an action only on DB changes? ...

Help with creating a dropdown and other elements for a FAQ page with Ruby on Rails.

Hi, I'm new to rails and I'm trying to make a help page that just lists questions and answers. Currently I have something very simple like this : <% @helps.each do |help| %> <%=h help.category %> <%=h help.question %> <%=h help.answer %> <% end %> Along with each question and answer is a category they belong to. How do i create a drop...

ajax "loading" icon with UpdatePanel postbacks

I have a form that is being dynamically built depending on user selection using Ajax (built in .NET Ajax with UpdatePanel). how can I insert a "standard" ajax loading icon (maybe have it attached to the mouse pointer) while the postback is happening then remove it when the post back is finished? I do have the AjaxToolKit installed if t...

Load javascripts inside jQuery Ajax

I have several javascripts at the head of my document, as well as at the bottom, near the body closing tag. I use jQuery to call an ajax element into place and the elements that are called, require these javascripts to function. How can I include these javascripts to work with the ajax call? Example: jQuery(document).ready(function(){...

Inserting AJAX page.insert_html for dynamic divs

I'm running into a little hiccup with my AJAX creation of comments for posts. Everything works great but I am doing this in the index.html.erb view so the create.js.erb is finding the first div that says "comments" and inserting the comment there. I know how to create a post specific div by using: <div id="comments_<%= post.id %> B...

What to have in mind when building a AJAX-based webapp

Hi everyone, We're in the first steps of what will be a AJAX-based webapp where information and generated HTML will be sent backwards and forwards with the help of JSON/POST techniques. We're able to get the data out quickly without putting to much load on the database with the help of a cache-layer that features memcached as well as d...

Javascript AJAX function returns undefined instead of true / false

I have a function that issues an AJAX call (via jQuery). In the complete section I have a function that says: complete: function(XMLHttpRequest, textStatus) { if(textStatus == "success") { return(true); } else { return(false); } } However, if I call this like so: if(callajax()) { // Do som...

Send a JavaScript array as a JSON value?

How can I send a JavaScript array as a JSON variable in my AJAX request? Thank you. ...

Re-binding an ajaxForm after content re-loads with ajax (jQuery 1.4.2)

I'm trying to figure out why this is a problem when using jQuery 1.4.2 and not 1.3.2. This is my function: function prepare_logo_upload() { $("#logo-upload-form").ajaxForm({ //alert(responseText); success: function(responseText) { //alert(responseText); ...

How to save (preserve) the zoom state of flot graphs on Update with AJAX

I have a simple application which polls database for data every minute. When new data is fetched, I am updating the graph using ajax. However, whenever I update the graph (re-plot it with new values added to plot data) the current state of zoom is lost. Before updating the graph, I want to preserve the latest zoom position. After updatin...

Ajax, Callback, postback and Sys.WebForms.PageRequestManager.getInstance().add_beginRequest

Hi, I have a user control which encapsulates a NumericUpDownExtender. This UserControl implements the interface ICallbackEventHandler, because I want that when a user changes the value of the textbox associated a custom event to be raised in the server. By the other hand each time an async postback is done I shoe a message of loading and...

Force a delay on Ajax responses when using the App Engine eclipse plugin?

I'd like to increase the time it takes the ajax to return in order to test various animations. By default it takes ~3-5ms. Is there a way to force a delay? I'm using java. ...

Progressive enhancement of anchor tags to avoid onclick="return false;"

Unobtrusive JS suggests that we don't have any onclick attributes in our HTML templates. <a href="/controller/foo/1">View Foo 1</a> A basic progressive enhancement is to convert that anchor tag to use XHR to retrieve a DOM fragment. So, I write JS to add an event listener for a."click" then make an XHR to a.href. Alas, the browser...

ajax modal popup not hiding in code behind?

I am trying to hide modal popup from code behind. But it is not working. <script type="text/javascript"> // a reference to the popup behavior var _popup; function LoadPopup() { // find the popup behavior this._popup = $find('mdlPopup'); // show the popup this._popup.show(); // sync...