xmlhttprequest

Which javaScript framework for cross-domain?

Hi All, I am building a web service that will make heavy use of cross-domain GET and POST data, and then update some lightbox or similar windows on the client. Is there one JavaScript framework that is better at this, or more importantly, a framework which I should avoid? I want to be able to put controls in the boxes. Really sexy bo...

Modify url of an XMLHttpRequest object

As a fix for this issue, I was wondering if anyone knows of a way to modify the URL of an XMLHttpRequest object prior to sending it. Ideally, I want to change the uri (encode it) in the beforeSend event (using jQuery $.ajaxSetup) instead of changing it in every location where I'm using $.ajax Thanks! ...

XMLHttpRequest() vs ActiveXObject("Microsoft.XMLHTTP") - what's the point?

Microsoft finally added the native XMLHttpRequest object in Internet Explorer 7, but I found out that it can be disabled in the Internet Options dialog. So what benefit is there using XMLHttpRequest() vs ActiveXObject("Microsoft.XMLHTTP")? If it can be disabled, that means we have to keep our browser compatibility checks in forever, do...

how to receive XML in IE8 with mootools

I'm doing a web where I heavily use AJAX requests to a XML service. In fact, my web is a front-end with almost no server whatsoever and uses AJAX to communicate with the back-end. Everything was going fine (I developed and tested in Ubuntu 9.04 and Firefox 3.0 as a browser). One day I decided to see how my web did in IE8... horror! Not...

Python POST XML not executed

The Headers post fine but the associated XML seems to be taken as string data only, XML is not processed. XML string is of the form: params = '''<?xml version="1.0" encoding"="UTF-8 "?> <MainRequest> <requestEnvelope><errorLanguage>en_US</errorLanguage> </requestEnvelope></MainRequest>''' The POST is of the form: enc_params = urllib....

jQuery return $.get data in a function

Hello, I'm trying to call a function that contains jQuery code. I want this function to return the results of the jQuery statement. It is not working and I'm trying to figure out why. function showGetResult (name) { var scriptURL = "somefile.php?name=" + name; return $.get(scriptURL, {}, function(data) { return data; }); } alert (s...

Detect browser support for cross-domain XMLHttpRequests?

I'm working on some Javascript that makes use of Firefox 3.5's ability to perform cross-domain XMLHttpRequests… But I'd like to fail gracefully if they aren't supported. Apart from actually making a cross-domain request, is there any way to detect a browser's support for them? ...

Basic Authentication With XMLHTTPRequest

Hi, I am attempting to use XMLHTTPRequest to get an update on twitter. var XMLReq = new XMLHttpRequest(); XMLReq.open("GET", "http://twitter.com/account/verify_credentials.json", false, "TestAct", "password"); XMLReq.send(null); However, using my sniffer I cannot see any authorization headers being passed through. Hence, I get a 401...

Access-Control-Allow-Origin Multiple Origin Domains?

Is there a way to allow multiple cross-domains using the Access-Control-Allow-Origin header? I'm aware of the *, but it is too open. I really want to allow just a couple domains. As an example, something like this: Access-Control-Allow-Origin: http://domain1.com, http://domain2.com I have tried the above code but it doesn't seem to ...

MooTools - Handle none JSON response

I use Request.Queue from more to fire my request one after one when the previous completes. Now I wonder how I should deal with requests that doesn't return json-encoded data (ie when a request fails and the script prints warnings and such). Currently the request.queue fails instead of moving on to the next and I wonder how to catch tha...

Render different template based on where request was called from?

I'm calling a controller action to do a search with an AJAX request from 2 different pages and want to render a different rjs file based on which page requested the action. I could just make 2 actions to do this but it doesn't seem very DRY when it's the same code in the action just need different rjs as it's displaying the search result...

jQuery ajax() call occasionally results in error with XmlHttpRequest response status of 0

One of the pages in our web application polls the server approximately every 10 seconds for new data, using jQuery's ajax() method. We normally have a few hundred users viewing this page simultaneously, so our server receives several requests per second. The load is not any sort of problem. For some small percentage of our visitors, the...

xmlHttpRequest and returned url

With help of xmlHttpRequest I make a server query. After that the server is redirecting to another page (e.g. "http://site.com/index.html;var=123") The question is - how can I get full url(side.com/index.html;var...)? The code is executed with Adobe Air. thanks ...

ASP.NET Session Variables -- Written by file upload -- Read by XMLHttpRequest to another page.

I am trying to implement a progress bar to monitor a file upload. The file is uploaded in an iframe and the server side C# code behind implements a buffer to upload the file in chunks. It uses a while loop to do this and upload performance seems to be fine with ASP.NET 3.5, and I really do not want to use a 3rd party control or a compl...

What is the Difference between submit() function and send() JavaScript functions?

Hi, I have been studying JavaScript from one book. Once I was playing with the codes concerning the client-server site communication, I wanted to do a POST request with the code below (which uses IE ActiveX object XMLHttpRequest): <script type="text/javascript"> var oRequest = HTTPRequestUtil.getXmlHttp(); var sRequestType = "post"; ...

How to emulate XMLHttpRequest client using PHP?

I'm looking for an example how to emulate XMLHttpRequest client using PHP. In other words, send the request over HTTP POST message, and receive and process the callback message. ...

HTTP 401 - what's an appropriate WWW-Authenticate header value?

Hi, The application I'm working on at the moment has a session timeout value. If the user hasn't interacted for longer than this value, the next page they try to load, they will be prompted to log in. All requests made are routed through this mechanism, which includes AJAX calls. Originally we were sending a 200 header with the login p...

Is nested XMLHttpRequests with multiple closures a good idea?

I have a Greasemonkey script which operates on a search results page at a video site. The function of the script is to take a javascript link that opens a new window with a flash player, jump through some redirection hoops, and insert a regular link to the desired FLV file. I have changed the script to do silly but structurally equival...

AJAX readystate

Hi All, This script sends a request to a Apache web server every 500ms to retrieve an XML document using AJAX. This script functioned correctly on all the browsers listed below until recently. Now the XMLHttpObject readyState will equal 4 for a minute or so but then will end up toggling between 0 and 1. When I refresh the web page, rea...

Prototype Ajax.Request only calling the last callback

Hi all, I'm writing a userscript for a website that uses Prototype. Rather than use the GM libs (mainly so I can easily repurpose it for Chrome), I decided to use the already-loaded Prototype functions. I'm iterating through the rows of a table, each signifying a unique user, by checking for an online status element on their profile pa...