ajax

Best way to add a 'callback' after a series of asynchronous XHR calls

Hey folks I stumbled on a piece of Ajax code that is not 100% safe since it's mixing asynchronous/synchronous type of code... so basically in the code below I have a jQuery.each in which it grabs information on the elements and launch an Ajax get request for each: $(search).each(function() { $.ajax({ url: 'save.x3?id='+$(this).attr(...

jQuery: Bind ajaxForm to a form on a page loaded via .load()

Hi, I'm using the ajaxForm plugin for jQuery to submit forms on my webapp. However, in one part of the app, I'm loading some content thathas a form on it via jQuery's .load() The problem lies in that I can't get ajaxForm to bind to the form loaded via ajax. I've tried this code to no avail: $('#viewRecordBtn').live('click', functio...

Another IE jQuery AJAX/post problem..

OK so i have this website, http://www.leinstein.dk. You will see "Hello World!" This is from ok.php, ive made a script that refreshes ok.php after 10 seconds. Anyways, This does not show in IE. I dont know why, and i hope you can help me out. Here's My script: function ajax_update() { cache: false /* var wrapperId = '#wtf'; */...

JQuery How to find out what the ajax error is?

I have the following bit of code which I'm just trying out by running in firebug $.ajax({ type:"POST", url:"http://mpdomain/WebService.asmx/Operation", data: "{'parameter1': '44906'}", contentType: "application/json;charset=utf-8", dataType: "json", success: function(data) { alert("succsess") }, error: function(e, ts, et)...

ASMX webservice with Guid parameter

I've got an asmx web service with the following method [WebMethod] public string LoadRegions(Guid id) { throw new NotImplementedException(); } When I attempt to call this method, I receive this exception: System.InvalidOperationException: LoadRegions Web Service method name is not valid. at System.Web.Service...

How to add an additional type to the ASP.NET script manager so that the script is generated?

When I add a service reference to my script manager, all the required C# classes are generated in the script, but one. This particular class is used as follows: [DataContract] public class MyObject { [DataMember] public string Id { get; set; } [DataMember] public bool Value { get; set; } } [DataContract] public class MyData { ...

CSRF attack detected when submitting data using ajax

Hi, I'm trying to submit a form using jquery in symfony 1.4, but CSRF attack detected error pops up each time. This is the code i use to submit the form data: $.ajax({ type: 'post', cache: false, url: $('#assign-form form').attr('action'), data: ( 'activity[id]=' + $('#activity_id').val() + '&act...

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...

jQuery Load an external script rich PHP file into local page

Hi guys, I've searched the entire web for a clear answer but haven't found one yet. I have this site: www.helixagent.com/todo/ and I want to load that entire site into a portlet in my main index page. I tried an iFrame approach but it fails to load the site correctly. The styles and javascript files don't get loaded (i think) Is th...

Jquery Tabs 1.8 ajax content > #history problem

Hey! I'm trying to load jQuery content in the same container (div#realContent) and it seems that when I use the a 'title' to enter the div ID (all links the same title) the history stop working. You can enter here http://home.d23.com.uy/fermata/ user: fermata pass: fermata , and see what I mean. Thanks ...

XmlHTTPRequest: "XML Parsing Error: no element found"

So I'm using PHP+MySQL to deliver database contents in XML to a JavaScript. $xml = "<?xml version='1.0' encoding='utf-8'?><confessions><pending>"; $pending = $m->MySqlHandler->Query("SELECT id, gender, age, confession, date_posted FROM confessions WHERE publish = 0"); foreach ($pending->Rows as $pr) { list($id, $gender, $age, $confe...

ajax collaps panel not working in my application?

hi, i am going to implement the collapsiblepane in my application but it is not getting any thing just two link buttons this is my code CollapsiblePanelExtender ID="CollapsiblePanelExtender1" AutoCollapse ="False" AutoExpand ="false" ScrollContents ="true" TargetControlID ="mypanel" Collapsed ="true" CollapsedSize ="...

what's the best (most effecient) way in asp .net to return a whole page into tabbed content?

what i want to do is every time i click on a tab, the content area is replaced by pretty much a whole new page. i don't want a full page load so i want to do it in ajax, but i'm used to sending back small jason data via page methods. i'm not sure how i would construct a whole new page and return that via ajax and i would like to simply...

Passing javascript code in JSON

I am making an AJAX call with jQuery to a PHP script that needs to return javascript code embedded in a JSON result for the jQuery code to execute. How do I go about passing javascript code in JSON? ...

what's the difference between ajax.org platform and ajax.org O3?

what's the difference between ajax.org platform and ajax.org O3? I tried to see this from site, but I didn't understood much. ...

When using $.ajax in jQuery, how can I deliberately throw an error in the loaded document?

In my document I have this script: $.ajax({ type:"POST",url:"ajax.php",data:data, success: function() { //onsuccess }, error: function() { //onerror } }); How can I, in the document ajax.php, deliberately throw an error? Is it sufficient to just throw an 400 HTTP Status Code or something? (And if so,...

AJAX UPDATE + PHP + IE = Fail?

Following from this thread: http://stackoverflow.com/questions/2209260/another-ie-jquery-ajax-post-problem (please read the thread to understand this one) Now i've got an solution for the thread above.. But, the ok.php (the site it updates each 10 seconds, with AJAX script) Doesn't show in IE if the response contain HTML code. With this...

Writing Ajax Form with IF ELSE statements...where did I go wrong?

Need some help with a #jQuery issue. Can someone look at this - http://bit.ly/avGLl4 - and tell me where I went wrong? ...

Button command firing twice with ButtonField inside GridView inside UpdatePanel with FireFox

I have an update panel which contains a GridView, inside which is a ButtonField. Whenever I press the button I see Firefox doing two POST's (via Firebug). One gets aborted right away, but does reach the server. This causes problems on my server side code as the command (a copy) gets executed twice. IE6 and IE8 do not exhibit this behavi...

How to auto-complete a form field with a city and state?

I have a free form textfield that allows a user to type in a city and state, e.g. "Chicago, IL". What I would like to do is when the user starts typing, to begin displaying suggestions of completed city+state combinmations (much like how Stackoverflow auto-suggestions the "tags" field below when you create a question). Question: Does a...