ajax

jQuery: Traversing AJAX response in Chrome/Safari

I'm trying to traverse an AJAX response, which contains a remote web page (an HTML output). My goal is to iterate through the 'script', 'link', and 'title' elements of the remote page - load them if necessary, and embed its contents to the current page. Its working great in FF/IE, but for some reason - Chrome & Safari behaves differen...

Jquery ajax() error : "Uncaught Syntax error, unrecognized expression: %2Cacpitool%2Caide"

Hello, I have a error when i tried to send post data with ajax() method. I have a array with : acpitool aide I use encodeURIComponent() for passing the array with data: but the ajax method fail. Could you help me? Thanks Edit : This is the ajax call $.ajax({ url: 'AjaxSearch.php', dataType: 'json', data: param+"...

How to enable favorite song feature with ajax in ASP.NET MVC2?

Say, we have a list of songs we want to display. If the user is logged in, he can favorite a song in a list of songs. We want to accomplish this using ajax. So we have the usual Song repository up, from where we fetch (paginated) songs and push them to view. In the view, we have something like <% foreach (Song song in Model) { %> .....

Can't seem to get Prototype AJAX form validation to work in conjunction with Codeigniter

Is there some kind of trick involved? Here's how I would envision it working: 1) User tries submitting the form 2) Event.observe captures this and sends an AJAX request to a special validation URL (PHP using Codeigniter) 3) If no errors were returned, continue submitting the original form 4) If errors were found, cancel form submiss...

How highlight words jquery ui autocomplete

i'm using this script http://jqueryui.com/demos/autocomplete/#default with database. i want to highlight typed words like this: www.docs.jquery.com/Plugins/Autocomplete. Please help me. ...

jQuery get attribute

There are many class="item" blocks on the page. For each one there is different var item_link and ajax request. Ajax searches for src attribute of .message img and throws it to var src. $(".item").each(function(){ var item_link = "http://..."; $(this).prepend('<div class="src"></div>'); $.get(item_link, function(data) { ...

css style remains after click

Hi All, I have a simple test page with a single styled button. I'm using a:hover when you hover over the button. However, when you click the button the a:hover style remains until I click on something else. How would I fix this and why is this happening? Thanks, rod. <asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" ru...

ASP.NET 4.0 routing + ajax + browser history

The problem with ASP.NET 4.0 routing is that the Page.RouteData.Values does not contain the paramenters after # character from the link System.Web.Routing.RouteTable.Routes.MapPageRoute("ProjectViewRoute1", "project/{title}/{idProject}#{idDesign}", "~/ProjectView.aspx"); As I said, the Page.RouteData.Values.ContainsKey("idDesign") w...

Ajax response takes time and status is 503

guys, i have a html page where onclick of a button a ajax request is sent to server , the request calls a jsp page which runs an oracle procedure.The procedure runs the logic and places it in a temp table . once procedure is completed , the values are returned to the client by selecting values from tmp table. as the response is too la...

jquery - why does $.ajax call the success handler when the request is aborted because my server is down?

When I bring my server down and make an ajax request to it, firebug shows that the request is aborted a few seconds after making the request, and my success handler gets called. Why does the success handler get called, shouldn't it be the error handler? And how can I reliably detect that it wasn't actually a success? CODE: ...

Update Message on ASP.NET ModelPopupExtender

Hi, I have a form in a MS AJAX ModalPopup Extender, which is in a UpdatePanel (for async loading). Everything works as expected. There is one thing that I am trying to do but not sure how to do it. On form submission, there is server side validation on top of client side validation. My question is: what is the best way to display valid...

Get variables in c# from ajax call

I've got an Ajax call for log in here is the code: //if MOUSE class is clicked $('.mouse').click(function () { //get the form to submit and return a message //how to call the function var name = $('#name').val(); var pwd2 = $('#pwd2').val(); $.ajax({ type:"POST", url: "http://localhost:51870...

jQuery sequence

$(".item").each(function(){ var item_link = $(this).find("a").attr("href"); $(this).prepend('<div class="img_url"></div>'); var img_url = $('div.img_url', this); $.get(item_link, function(data) { var src = $('.poster img', data).attr('src'); img_url.html(src); }); }); Each .get should be started afte...

MVC2 Ajax Form does unwanted page refresh

Hi, I am pretty new to MVC. I have my first Ajax Form here: <div id="test"></div> <div id="MainChatMenu"> <% using (Ajax.BeginForm("SendMessage", "MainChat", new AjaxOptions { UpdateTargetId="test"})) { %> <input id="chatMessageText" type="text" maxlength="200" /> <input type="submit" value="Go"/> <% } %> Now, if I click the sub...

[CPAINT Error] invalid HTTP response code ‘0’

Hello all, I am trying to make use of a script that uses CPAINT and I keep getting the error above when I click on favourite an item (a 5 star rating system). It looks like it is making an AJAX request but I can not see this from my Firebug to debug this - why is this the case? More importantly what does the error code 0 mean? Thank ...

jQuery Ajax call to WCF service returning "Method not allowed (405)"

I created a WCF SOAP service using VS 2008 that works server side. I tacked on the code below to call the same service/contract client side using jQuery/json (no ASP.NET scriptmanager). When I put the service url into the browser, I get the correct service page and when I invoke the service from javascript and trace via Firebug, I get ...

Listview commandButtons inside an asp:updatePanel not working correctly

Hi, As the topic describes, i have a listview inside of an updatePanel which is causing me some problems. Each item in the listview has an edit command button, which works perfectly fine when not using the updatePanel. When using the updatePanel however, only the button in the very first item works. The other buttons fire an asyncPost...

Store form values for later submission

I have a Rails app that lets users create tutorials and quizzes. There are many users taking the quizzes and many quizzes in a tutorial. My client wants the quiz results to persist when a student navigates away from the quiz. So the use case would be: User starts to take quiz User answers some of the questions User navigates away from ...

AJAX Issue, Works in all browsers except IE

Alright, this code works in Chrome and FF, but not IE (which is to be expected). Does anyone see anything wrong with this code that would render it useless in IE? var waittime=400; chatmsg = document.getElementById("chatmsg"); room = document.getElementById("roomid").value; sessid = document.getElementById("sessid").value; chatmsg.focu...

Empty "for" loop in Facebook ajax

While surfing facebook and using the Firebug network debugger I noticed that facebook's AJAX responses all start with an empty for loop. Example: for(;;);{...} Does anyone know why this is done? I assume it's to prevent some sort of XSS attack but I don't totally understand. Thanks! ...