jquery-ajax

How to read json response as name value pairs in JQuery

I want to read json response as name and value pairs in my JQuery code. Here is my sample JSON response that I return from my java code: String jsonResponse = "{"name1":"value1", "name2:value2"}; in my JQuery, if I write jsonResponse.name1, I will get value as "value1". Here is my JQuery code $.ajax({ type: 'POST', dataType:'...

Timing JQuery AJAX calls

I'm working with the FullCalendar plugin, and running into some issues when trying to populate my list of divs (events) and then initializing them into FullCalendar event objects. Initially, the events were hard coded, so everything was working fine. Then I tried this to populate my Event options first: //This part is working $(doc...

jQuery Deep Linking a Web App

Question... I want to build a one page web app that has deep linking (the url changes on click to where the user is loading) so the user can share links, bookmark, etc... The issue with the jQuery BBQ plugin is that it requires the href to have a hash in it like href="#/photos/1" That means I need to make sure every URL in my app start...

Strange behaviour

I have the following script which works kind of... $(document).ready(function(){ // add or remove from favorites $("input:checkbox").change(function() { if($(this).is(":checked")) { $.ajax({ url: 'favorite.aspx', type: 'POST', data: { ID:$(this).attr("id"), St...

Jquery events do not trigger on content loaded via load()

What is the appropriate method to get the already-initialized javascript to interact with content loaded using jQuery's load() method? Example: You have a table with an onclick event for each row, then append() a new row to the table, suddenly the onclick() event does not fire. Hopefully it is possible to do this without manually re-in...

jQuery live help.

I have the following script which works perfectly until I regenerate the links ".resultLink" via jquery ajax: $("a.resultLink").live('click', function() { var that = this; $.ajax({ url: 'most_used.aspx', type: 'POST', data: { strMostUsedID:$(that).attr("href") }, error: function() { }, su...

No response from MediaWiki API using jQuery

Hi. I've tried to get some content from Wikipedia as JSON: $.getJSON("http://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&titles="+title+"&format=json", function(data) { doSomethingWith(data); }); But I got nothing in response. If I paste to browser adressbar something like that: http://en...

.serialize() not returning values from dynamically generated form

I'm missing something here. I have a form dynamically loading a form using jquery where .click() pulls in a $.post query that outputs the form with some specific data to .html(). I'm now trying to serialize the data from this form and it's not giving me anything. What am I doing wrong? Code inserting form: $(".edit").click(function...

Session Storage and pagination mvc

Hi I'm not sure if this is the best approach so hoping for some advice. I have a pager that updates the page using ajax. I'd like the user to be able to select the size of the page they require I'm doing this with a form and some jquery which calls an action method that sets the Session["PageSize"] value which is used to determine how ...

4-States button (with .toggle()) and delayed Ajax in each state

Hi, I've got a 4-states button. I would like to know how to delay the execution of my ajax request in order to have only one request at the end... I mean, if I press the button twice, i don't want to execute the first ajax request, but only the second one after a specific timeout. $('.btn_mark_erreur').toggle( function (){ //St...

jQuery tab IE7,IE6 bug: ajax has no GET request

I remove initialIndex:0, so http://dl.dropbox.com/u/6594481/tabs-2010/get-request1.html#two.html will get one ajax GET request in Firebug console. Unfortunately it stopped to get ajax request for http://dl.dropbox.com/u/6594481/tabs-2010/get-request1.html on IE7 and IE6, on other browsers it works fine. What is the issue for that? check...

IE document.ready() not triggered after ajax request

document.ready() not triggered after ajax request in IE but work a charm in FF and chrome. I have two files. First file(test.jsp) just has a submit button. onclick it loads from struts the second file(result.jsp). . the two files are test.jsp <html> <head> <script type="text/javascript" src="/js/jquery-1.2.6.min.js"/></script> <sc...

Returning a response on error in AJAX call using ASP.NET MVC and jQuery?

Hi, In my controller's action method, I call a WCF service, which could return a FaultException containing a business rule violation message. I have a BaseController that overrides the OnException method as below. Since I call the controller action using AJAX, I check if the request is AJAX and only return a Content result. If it was n...

How can I use jQuery Ajax and PageMethods with instance variables?

One reason we currently use UpdatePanels for doing our AJAX is because our BL and DA layers pass around the Page.User.Identity for authentication. Is there a way to access this? ...

Editing results while being appended?

I have the following script which displays data returned from a serverside page onto the clientside page: function getResults() { var search; search = $(".txtSearch").val(); $.ajax({ url: 'search.aspx', type: 'POST', data: { strPhrase:search }, error: function(xhr, status, error) su...

Uploading files with jquery's .post

Hi, I have form that uploads file's perfectly, with a post-page-refresh-form. However I have ajaxiefied the form with jquery's $.post All of the data except for the file upload is saving nicely. Is there somthing special I need to do to the form or in jquery to get the upload to work? Thanks! ...

jQuery autosave form script help

Hi can anyone assistant me with getting this piece of jquery code to work properly. I like jquery but a lot of the times developers are very vague on how to use there custom coding. I guess they just assume you should know certain things. I'm trying to use this on a Form with checkbox, radio, dropdown and inputbox then have a php file ha...

why can't we access values on server side in POST request?

I tried to send the request from jquery ajax with contentType as 'text/plain'. I am unable to access the values on the server side. I am accessing the values using $_POST array in php file. Why is this happening. jQuery AJAX code: $.ajax({ type: "POST", data: {o_pass:o_pass,n_pass:n_pass}, url: "changepass", succes...

Edit returned results before appending on screen.

I have the following script which I need to combine together somehow. Each function works individually at the moment. // Check if file exists clientside function FileExists(path) { var fso = new ActiveXObject("Scripting.FileSystemObject"); FileExist = fso.FileExists(path); if (FileExist == true){ return true }...

How to implement an "Auto Save" or "Save Draft" feature in ASP.NET?

I have a registration form in ASP.NET 2.0. I want to save my registration form fields either by clicking on submit button or they should be saved every five seconds. For example I have three fields in my registration page: UID PWD Name The user has entered UID and PWD and whilst he is entering Name the previous values should...