jquery-ajax

Accordions are nesting

I am building some accordions dynamically from some data that gets returned from the database, What should happen is that the user clicks on a link for the Blog, the blog accordion appears with header blog and click on that triggers the accordion affect. This bit works fine, the problem comes then the category blog has more than one of...

struts2/ajax/jQuery dialog behavior

I'm trying to use a jQuery dialog to submit a form via ajax to my struts2 action. On success, I'm redirecting to a different page. This is working great. The issue I'm having is handling non-success result types from my action. What I'd like to happen is for my action/field errors to somehow get populated into my dialog so that the u...

Client-side templating frameworks to streamline using jQuery with REST/JSON

I'm starting to migrate some html generation tasks from a server-side framework to the client. I'm using jQuery on the client. My goal is to get JSON data via a REST api and use this data to populate HTML into the page. Right now, when a user on my site clicks a link to My Projects, the server generates HTML like this: <dl> <dt>Cl...

Jquery Validation plugin and Colorbox

Does anyone know the best way to get the Jquery Validation plugin to run when submitting a form that has been loaded dynamically into a Jquery Colorbox modal window? ...

javascript critical sections or semaphore problem

function myobj(){ var gup=this; this.lastindex=-1; this.criticalSectionInTimer=0; this.updateTimer; this.start = function(l){ if((typeof this.updateTimer)=="number"){ clearInterval ( this.updateTimer ); } this.updateTimer=setInterval(function() {gup.getMessages();} , 30); } this.stop= functio...

Sending a multi-level javascript object to the server with AJAX fails

I have a javascript object that looks somthing like this: var obj = { "name": "username", "userid": "9999", "object1": { "subObject1": { "subArray1": [], "subArray2": [] }, "subObject2": { "subArray3": [], "subArray4": [] } }, "object2"...

Create Local Javascript Array From jQuery.get() AJAX Call

I'm using the jQuery Autocomplete plugin and would like to store all the autocomplete values locally in an array. I'm able to retrieve a comma separated list from a url using jQuery.load() or jQuery.get(). However, I can't load the data into an array successfully. Any suggestions on how to get this working? I realize there's probably...

jQuery Ajax (beforeSend and complete) working properly on FireFox but not on IE8 and Chrome

I am using jQuery ajax version 1.4.1 in my MVC application (though the issue I am discussing was same with the old jQuery version 3.2.1) as well, to check during customer registration if the username is already registered. As the user clicks on the "Check Availibility" button, I am showing a busy image in place of the check button (actua...

Escaping jQuery data being sent via POST

I'm using jQuery.ajax to extract form data from a page, and send it to my database (via another PHP page). The form information is collected by: var X=$('#div1').val(); var Y=$('#div2').val(); This is used to build the POST string, i.e. var data='varx='+X+'&vary='+Y; Obviously this is problematic if an ampersand character is used....

How do I call a controller method from JQuery?

I have ajax code for asp.net (non-mvc) to call to a webMethod to get additional data from the server for a request. But I can't seem to figure out the url to give my JQuery in MVC. <script type="text/javascript" language="javascript"> function SubmitAjax(url, message, successFunc, errorFunc) { $.ajax({ type:"POST", u...

shadowbox display of html drawn from another page via jQuery.get()

I'm a bit new to the Ajax thing and am hoping you all can suggest which of these two methods is most efficient. Both approaches seem to work, but perhaps there is some better way altogether? thisPage.html wants to display a blob of html drawn from thatPage.html (on the same host) in response to a click on a link. I'm using Shadowbox's ...

jquery ajax data string. How do i make an object or escape the string?

I have a button which calls jquery.ajax and submits POST data. I need to get user text from a textarea. So far, no problem. However now i need to set the post data. I have a string in the form as k=v&k2=v2 etc and then i have this user text. I obviously cant write + "&usertext=" + usertext since the text may have code and &kxxx=val which...

jQuery get(), Shadowbox, return the whole html of the containing div

Related to my earlier question (thanks for your response Cryo), I have a further question for the javaScript mavens here. Given an html structure like this: <content> <div entry> <div rubric> <a name> </div> <div content block> <p> <a links> </div> </div entry>...

jquery Help with getting Id of table row

Hello, I am doing an AJAX request with Jquery and PHP what I am doing is looping through an array and producing a table, each loop a new is created and an id is given to it, when they click the read me link the ajax and some more content is returned, on clicking read more I want the associated table row to be removed from the table is th...

Jquery $.ajax callback not being called in ASP.NET MVC View Page

I have a simple ajax call: $.ajax({url: my_url_here, dataType: 'text', success: function(data, textStatus) { if(textStatus == "success") { alert('success'); } else { alert('fail'); } }, error: function(XMLHttpRequest, textStatus, ...

how to show a modal Loading ... while a ajax request $.get/$.post is running ?

I have a web application in asp.net, mvc and sometimes my ajax request might take more than 1 second. So I need to show a big div over the entire page (Loading...) while this request is working and to hide it when it's finished. Does anybody know how to do this ? ...

reload a table after link click to update results

Hello, I am have a table that shows the user suggestions that they have recieved on clicking read more some ajax is fired and in the database the suggestion is marked as read. Currently if the suggestion is new I show a closed envelope, if it is read I show an open envelope, however I can get it to reload the table when the user clicks...

jQuery ajax and javascript objects

Hello, i've used prototype before, and i'm trying to learn jquery now. The problem: I have an object that makes an ajax call, and i want the success callback to call a function within my object. The problem is that inside the callback function, "this" does not point to my original class. Example: function C(){ this.loadData(); } C....

Browers entering "busy" state on Ajax request

I am currently implementing a sort of HTTP Push using Long Polling for browsers that don't support multipart ajax responses. I have to admit that while the server side is working fine, i am relativly new to front end javascript development, and thus may have made some obvious mistakes The problem is as follows LongPolling works perfect...

Jquery: Select menu to show and hide certain div elements

Hello, I'm looking to create a select menu that shows and hide certain divs based on the selected option; something like this: <select name="choose_colors" id="color_selector"> <option value="select_color">Select color</option> <option value="red">Choose Red</option> <option value="blue">Choose Blue</option> <option value="gree...