ajax

AJAX POST and Plus Sign ( + ) -- How to Encode?

I'm POSTing the contents of a form field via AJAX to a PHP script and using Javascript encode(field_contents). The problem is that any plus signs are being stripped out and replaced by spaces. How can I safely 'encode' the plus sign and then appropriately 'decode' it on the PHP side? ...

How do I bind a click event to created dom elements in a jQuery $.each loop? only seems to be binding to the last element!

Consider the following code, in theory the click event should bind to each element but for some reason (unbeknown to me) it will only bind to the last link. does anyone have any ideas? $.each(data, function(i,aitem){ linkid = 'address'+i; $("#SearchResults").html($("#SearchResults").html()+'<p><a id="'+linkid+'" href="#">'+ aitem...

What is the consequence of not using a key with google ajax api load

I can call the google api this way with a key : <script src="http://www.google.com/jsapi?key=ABQIAAAA1XbMiDxx_BTCY2_FkPh06RRaGTYH6UMl8mADNa0YKuWNNa8VNxQEerTAUcfkyrr6OwBovxn7TDAH5Q"&gt;&lt;/script&gt; But i can also omit to specify a key like this: <script src="http://www.google.com/jsapi"&gt;&lt;/script&gt; and my code still work. ...

Threading using AJAX

When the user clicks on a link to generate report I make an AJAX call which generates a pdf file in the background.Now the files are huge running upto 10mb or more.So it takes some time.In the mean time the user should be able to navigate other links as if nothing has happened.So I need to implement in such a way that the pdf generation ...

Keep a shopping cart updated without relying on an 'Update Cart' button

Am in the process of implementing a fairly conventional shopping checkout flow. Currently it steps thru like: User adds an item to the cart and is presented with Step1 (login or register as new customer) User is presented with summary of current the order and a handful of controls that modify the order. After confirming the desired co...

How should ajax request html files be formatted?

Im using jquery UI's tabs with ajax. I was wondering if the files that the ajax calls are gonna retrieve are supposed to be formatted starting with <html> or just the minimal html possible cause its gonna be injected into an already formatted valid xhtml file.... I hope Im making myself clear. Thanks in advance. ...

What Maps API other than Google's do you use with GWT?

It seems that licensing terms would prevent us from using Google Maps API in our software. We would prefer to be absolutely free open source and Google Maps API will require commercial license if our software is sold (correct me if I am wrong - I will delete this question then :-). So the question is if there are alternative map APIs f...

Dealing with unsaved form data when user closes the browser

I'm having hard time trying to figure out how to auto-save user data in a form when the browser is being closed or user changes the page. The onBeforeUnload event is OK when you want to open a dialog box, but by then it's too late to save the changes (except if you just block the browser in the onBeforeUnload handler long enough for it t...

Ajax request and callback update are triggering at the same time.

Hi All, I have some submit buttons that are defined in the following manner: <input id="add_200,231" type="submit" onclick="updatePage(401,27371,200,231)" value="Add"/> The corresponding javascript function referenced in "onclick" looks like this : function updatePage(slac,sci,tlac,tci) { var url = '/neighbouring?.state=add_cell&so...

GET vs. POST ajax requests: When and how to use either?

What are the strengths of GET over POST and vice versa when creating an ajax request? How do I know which I should use at any given time? Is it a security-minded decision? Also, what is the difference in how they are actually sent? ...

Implementing "this is taking too long" message with jQuery

How to implement a gmail-like "this is taking too long" warning message using jQuery Ajax API? For those who have never seen this message on gmail, it appears when the 'signing in' process takes too long for completion, and then some solutions are suggested. I'm using jQuery Ajax on my website and I want to warn users when page loading...

Codeigniter + jquery: specify MIME type text/xml in ajax request response

I am making an ajax request from a jquery script to one of my ajax controllers in codeigniter. This process works fine when using data type json. However, when I want to send xml back from the server, the jquery documentation says that the server must specify a MIME type of text/xml. How do I do this with codeigniter. My ajax call loo...

jquery ajax with two service calls

Is there a better to write the following? I have two services that I need to call. The data returned from the first service is needed to create the url for the second ajax call. $.ajax({ url: 'http://service', type: 'GET', dataType: 'json', timeout: 1000, error: function(){ alert('Error loading jso...

AJAX call to php file doesnt work in ie8

But it works in firefox. This is my javascript: star.updateRating=function(v, listid) { xmlHttp=GetXmlHttpObject(); if (xmlHttp==null) { alert("Your browser does not support AJAX!"); return; } var randomnbr = randomID(12); var cacheid = randomnbr+"_"+listid; var url="http://mywebsiteurl.com/includes/functions_rating.php"; ...

selecting an a default date today date in atextbox using ajax calendar control

hi, i have textbox , and i am using ajax calendar control. by default the textbox should show today date like ( 04/08/2009 ) and if the user wants to change the d ate he can clik on the textbox which will pop up a ajax calendar control. sothere he can select. by default the textbox should always show 2day d...

How to build an interactive Ajax Web Widget?

Hi, I am looking to create a web widget that can be easily integrated into any website using javascript and posts a form to my server, returns the data and displays the results appropriately. This will all happend in a small area of the host websites screen, like google adsense. I am aware that this is XSS and also the cross domain issu...

result inside a sx:tabbedpanel? STRUTS AJAX

Hi, I am quite new to struts. I have a sx:tabbedpanel with three s:divs inside of it. <sx:tabbedpanel id="mainContainer" > <sx:div label="View Files" cssStyle="height:200px;margin:20%;" href="ShowFiles.action"> loading... </sx:div> <sx:div label="Upload Files" href="ShowFileUpload.action" closable="false"> ....

Ruby on Rails AJAX file upload

Is there any easy way how to handle AJAX file upload in Rails? e.g. with a plugin ...

dojo filteringSelect is very slow

Hello friends, In my project I am fetching cities using country selected. Now I have about 8000 cities for 1 country, and because of that filteringSelect takes time to show it fast. following are ajax functions I am using to fetch records and display it in my page. function GetCities(){ dojo.xhrPost({ url: 'GetCitiesForCountry....

Move divtag and store position in database?

Hi, I want users on my website to be able to "move" div tags once they are 'unlocked' and then for a php script to store the positions in mysql database. So once the user re-logs in the div tags are positioned in the correct place. I know how to postion div tags in css, and am using php varibles within css to pull the data from the data...