ajax

How do I get the browser to update before my next Javascript function is called?

Hey all, I'm having a bit of trouble getting the desired functionality from my function... Basically, I'm making two calls to AJAX functions (as provided by Oracle APEX, so I can't change these) but they're taking a while. I'd like to show the standard AJAXy spinning gif while the action was going on, but I'm not having much luck. He...

ASP.NET AJAX postback and jQuery

I have a Textbox, a LinkButton and a RadioButtonList inside an UpdatePanel. When the button is clicked, the UpdatePanel shows matching items in the radiobuttonlist. This works fine, but I now need to make the same happen OnKeyDown on the TextBox. I'm trying to cancel all AJAX requests in progress but not having much luck. Firstly, on ev...

Load ajaxdata in HTML or JSON-format?

What's a better practice? Load data in HTMLformat or JSON-format? When I load HTML i'm able to keep all the html in my php view-file. When i load JSON I have to put it in html elements clientside with javascript. I know that a 'best-practice-question' isn't suitable for stackoverflow. So a better answer to my question is a list of benef...

POST to server, receive PDF, deliver to user w/ jQuery

I have a link that the user clicks to get a PDF. In jQuery, I create a POST ajax call to the server to get the PDF. The PDF comes to me with the correct content headers etc that would normally cause the browser to open the Reader plugin, or allow the user to save the PDF. Since I am getting the PDF w/ an ajax call, I'm not sure what t...

jQuery - polling of a job queue

I have a database table which contains a queue of jobs. A separate program processes these jobs. I want to provide a webpage for users to watch the progress of the queue. The Server side scripting to query the table and return it in a JSON format is no problem. I've done some reading on jQuery and the PeriodicalUpdater plugin. I'm wonde...

how to prevent users' interaction when waiting for ajax's response

The scenario is like: I'm using Jquery to implement some ajax features. For example: when a user click a button "get data", Jquery will call .ajax function to fetch some data from the server. This process might take some time, so I added .ajaxSend and .ajaxComplete functions to show some animation for the waiting process (actually a 'Loa...

how to check if request is ajax in turbogears

How do I go about checking if a request is an ajax request in a controller method in Turbogears? Further, is it possible to return a 'partial' much like in rails or symfony if the request is an ajax request. I know about the json decorator but I need a way to return a partial of a mako template (because I need to format the data and don'...

How do I use Ajax and Jquery to pull information off a PHP database, and populate elements with that information?

Hey everyone, I am tweaking a website to make it easier for employees to edit products. Right now, someone has to login to the DB and change prices, and then someone has to change the physical html of the website itself. So I am writing code that pulls all the products off the DB, and displays them on a page which can be edited. I thi...

performing jQuery show/hide on dynamically created content

I have a page I created with jQuery, and in this page is a table where the table rows have classnames that identify them as a certain color (i.e. tr class="yellowclass"). The user is able to filter rows by clicking a checkbox that will show/hide tables of a certain color. My problem is that the table is generated on the fly via getJS...

How to I use ajax and PHP to create and populate div elements?

Hello, I asked a similar question earlier here, and it got me down the right track, but I am little stumped still. However, now I know how to ask a more educated question. I have a database I connect to, with a table name of PRODUCTS. Within PRODUCTS are the columns ID, STOCK, SHORTNAME, DESCRIPTION, PRICE and SHIPPING. If the user cl...

XML not loading with jquery GET but does load with direct link and php?

Im attempting to pull in an xml feed that I can load up with php and simpleXML and I can view the direct link, but when I try to use jquery and GET it just times out and I never get a response, the error that comes back is undefined. Here is the code im using $.ajax({ type: "GET", url: "myurlishere", dataType: "xml", timeout: 1000, con...

jQuery.ajax() sends POST requests as GET in a Chrome extension

I'm building a small Chrome extension that must send messages through a POST http request to a server in my company network, and I'm using jQuery 1.4.1 to speed up the development of the javascript part. I have this code to send the request: function send() { $.ajax({ url: "http://mycompany.com/update", method: "P...

Is it possible to get a browser window to update while it is in a Javascript loop?

I have an Ajax call that currently needs to be synchronous. However, while this Ajax call is executing, the browser interface freezes, until the call returns. In cases of timeout, this can freeze the browser for a significant period of time. Is there any way to get the browser (any browser) to refresh the user interface, but not execute...

Sys.WebForms.PageRequestManager._initialize does not render in my ASP.Net page

The code below does not render in my ASP.NET page, and on click of the button my page posts back. Sys dot WebForms dot PageRequestManager dot _initialize('ScriptManager1', document dot getElementById('form1')); Sys dot WebForms dot PageRequestManager dot getInstance() dot _updateControls(['tUpdatePanel1'], [], [], 90); although i see ...

jQuery.ajax gives "TypeError: Cannot read property 'documentElement' of null" on server but not local.

I'm having a problem with my jQuery code on http://alpha.spherecat1.com/, but the local copy works fine. As you can see if you visit the site now, the ajax call gives the following error: "TypeError: Cannot read property 'documentElement' of null" I've checked and rechecked and reuploaded everything I can think of. The documentation sa...

Prevent closing of ModalPopup on postback

Hi, I'm using the ModalPopupExtender control from the AJAX toolkit. This control extends a panel which contains a CreateUserWizard control. However, the validation of the CreateUserWizard control causes a postback to the server, which closes the popup. I'd like the popup to remain open, even after the postback. From what I can gather, ...

What are the best practices when using jQuery Ajax calls?

I'm reviewing some code for a colleague and while there's nothing inherently wrong with the jQuery Ajax calls I'm looking at, I would like to be more certain about what should and should not appear in a normal Ajax call to an ASP.Net MVC controller action. For example, in the following code: $(function() { $.ajax({ ...

PHP - Show status of a form that is processing

I have a form that performs 3 separate tasks when submitted. When the form is submitted, a lightbox/thickbox window appears to show the status. The page posts to itself, and as it completes a task, it writes to the database containing a 'status' field. All this is working fine. I need the current status to appear/refresh in the lightb...

Passing form data to asp.net mvc controller action using JQuery

Hi to all, Basically, I have an HTML Form and would want to pass the data from the form to n asp.net mvc controller, then the controller would return an XML for client side manipulation. Here is my initial code: Client: $(function() { $('#btnSubmit').click(function() { $.post('/Home/Create', $('form').serialize(), functio...

javascript restricting???

is it possible to restrict javascript libraries from being able to manipulate the dom? im trying to create a system that has a main system with the api which will be able to manipulate the dom and then i want to give the ability to create third party scripts but have them limited to only the api functions. ...