ajax

jQuery / Ajax - $.ajax() Passing Parameters to Callback - Good Pattern to Use?

JavaScript code I'm starting with: function doSomething(url) { $.ajax({ type: "GET", url: url, dataType: "xml", success: rssToTarget }); } Pattern I would like to use: //where elem is the target that should receive new items via DOM (appendChild) function doSomething(url, elem) { ...

Using UpdatePanel with NestedMasterPage

Hi, I have a web site that contains Master Pages as follows: ApplicationFolder Root.Master User Folder User.Master inherited from Root.Master Data.aspx inherited from User.Master In Root.Master Page There is a ScriptManager control I put to Root.Master in case I can use updatepanel in any page....

Call jQuery script located at server (and referanced by client) works on IE not FF and not Chrome

Hi, I have the following situation, i have a service project (ASMX) and a web project (ASPX) which i run localy on ASP.NET Development Server. I have a jQuery script that contain a handfull of functions which is calling the local asmx service (hence, the jQuery script is on the service project /Scripts - doing some database insertion a...

Ajax, back button and DOM updates

If javascript modifies DOM in page A, user navigates to page B and then hits back button to get back to the page A. All modifications to DOM of page A are lost and user is presented with version that was originally retrieved from the server. It works that way on stackoverflow, reddit and many other popular websites. (try to add test com...

Rails/Prototype "submit_tag" not working in Firefox

I have the following Rails partial... <% remote_form_for :ride, :url => {:action => "create"}, :html => {:id => form_name} do |f| %> <%= f.error_messages %> <td> <%= f.text_field :name %> </td> <td> <%= f.text_field :land %> </td> <td> <%= f.text_field :height_restriction %> </td> <td colspan="2"> <%= sub...

Javascript Menu OnBlur Issue

So I'm creating a javascript menu and trying to implement an onblur event for when a user clicks something outside the menu so it will collaspe. To implement this, I simply attached an event to the window and looked for any clicks and if it nor its parents elements didn't meet a certain criteria then I would close the menu. This works ...

Way to know when last AJAX call has completed in jQuery?

One of my pages has about 5 jQuery AJAX calls that fire off as soon as the page loads. I know that I can track each AJAX call individually and know when it is complete, but is there any way to track them as a whole? This way, I'll know when the last AJAX call is complete and I can signal a UI change. I guess I could keep a running count...

Why is this JSON not being parsed correctly?

My problem is that this JSON is not being parsed by JavaScript or the jQuery API. I am including the code below and a URL where the JSON output is. This JSON is being parsed in JavaScript as nothing: //something like this: alert(data); // gives an object alert(data.horas[0].hora; // gives undefined The JSON itself: {"horas": [{"hora...

.aspx page dedicated to respond to ajax requests, how to set content type

Hi, I am creating a .aspx page to respond to ajax requests. If I return json back, how do I set the content type so my calling page receives the JSON properly? I'm using jquery if that matters. ...

Cross-site AJAX using jQuery

Hello, I have an existing jQuery plugin which makes a lot of AJAX calls (mostly JSON). I am wondering what is the quickest to allow it to do cross-site calls i.e. the $.get and $.post URL's will not be from the same domain. I have heard of JSONP, but was wondering if someone could give me an concrete example to go about the whole proce...

What are the cases when AJAX should not be used?

It seems that the sites and applications that use AJAX are growing rapidly. And probably one of the major reasons for using AJAX is to enhance the user experience. My concern is that just because the project CAN use AJAX, doesn't mean that it SHOULD. It could be that AJAX is exposing more security threats to the site/app for the sake o...

jquery ajax call not working?! firefox or xss problem?

My problem is: in firefox i got no response. in ie it worked fine. I want a ajax call to a local script getting some information in plain text or something else. but it won't work. I think cross scripting should not a problem at this point or? the javascript code is simple: var targetUrl = "http://localhost/jQueryProxy.php"; var parame...

QTP Web extensibilty toolkit and ajax

I'm trying to test using QTP a web app that is using ajax4jsf to implement the ajax features. QTP doesn't have the ability to recognize when the ajax had finished. I've read that the web extensibility toolkit that is provided with QTP 9.5 and QTP 10 is the solution for my problem. However, I can't understand how this can help me: I need ...

Ajax error - "permission denied"

Sorry, this looks longer than it probably is but I thought I should include all the information! I'm using a simple Ajax script to dynamically bring content into a <div> on a page. The first request to load some new content into the div works fine, but if I've got an Ajax "back" link within the content which has just loaded, it seems to...

setTimeout with ajax chat

Ok Hi Help help help I am having a major problem with setTimeout it is not working and i did everything not working I am developping a chat system so i need to send and recieve messages (i test it by opening 2 browser windows) Here is the code i changed many times I hope any one can help me javascript $(document).ready(function() ...

Help with consuming JSON feed with PHP & json_decode

Hello there! I've having an issue with consuming a particular feed for a client. They have given me a remote URL and the response is a JSON string like so: {"affiliate": [ {"ID":"1", "COUNTRY":"EXAMPLE", "NETWORK":"EXAMPLE", "PRIMARY":"EXAMPLE"}, {"ID":"2", "EXAMPLE":"EXAMPLE", "COUNTRY":"EXAMPLE", "NETWORK":"EXAMPLE", "PRIMARY":"EXAMPL...

howto get AJAX selected option displayed in select box

I am populating a select box from jquery $.post(); The option values returned from the post have one option with " selected='selected' " but rather than setting the control to this option the last option in the string is selected and displayed. The last option has it's selected property set to true but firebug shows the selected text a...

PHP showing output of foreach to screen, for each item

One thing I have noticed with php, is that nothing is output to the screen until the script has stopped working. For the project I am working on I feed in a list of over 100 items and it performs a HTTP request for each item and when finished, shows a page with the status of each item, success failure etc. What I want to know is if ther...

jQuery.ajax fails when url is from different server

Why does jQuery.ajax() throw an error with no error message if you use a URL with a dfferent server? ...

jquery ajax events called on every element in the page when only targeted at one element

So, you have a page: <html><head> <script type="text/javascript" src="jquery.1.3.2.js"></script> <script type="text/javascript"> $(function() { var onajax = function(e) { alert($(e.target).text()); }; var onclick = function(e) { $(e.target).load('foobar'); }; $('#a,#b').ajaxStart(onajax).click(onclick); }); </script></head><body> ...