xmlhttprequest

Empty responseText from XMLHttpRequest

I have written an XMLHttpRequest which runs fine but returns an empty responseText. The javascript is as follows: var anUrl = "http://api.xxx.com/rates/csv/rates.txt"; var myRequest = new XMLHttpRequest(); callAjax(anUrl); function callAjax(url) { myRequest.open("GET", url, true); myRequest.onreadystatechange = resp...

xmlHttp string POST Headers issue

i am trying to pass a string through the XmlHttp method. Let me show you the code: HTML <div id="greetings"> You are voting out <b style="color: #00b0de;" id=roadiename></b>. Care to explain why?<br/><br/> <textarea name="textarea" id="comment" cols="38" rows="7"></textarea><br> <a href="#" id="postmsg" onclick=...

ajax request to download an excel file is showing me truncated response

I am trying to download an Excel file using Ajax (XMLHttpRequest). On completion the responseText is found to have just 5 characters. The network sniffing tool (Fiddler) is showing me that my computer received the entire file.. so why is the responseText showing me only 5 characters? I have tried both Synch and Asynch calls. Thanks ...

Custom Live Validation Function

Hi, I've been trying to create my own custom LiveValidation ([LiveValidation.com]) function that connects to a database and checks if a username already exists. This is the relevant part of the form: Username: <input type="text" name="username" id="username" class="textinput"> <script type="text/javascript"> var username = new Li...

jQuery load() throws "permission denied" error in IE

Hi, I'm loading a page through AJAX with jQuery's load() function. It doesn't work in IE8, giving the "permission denied" error. Using the IE debugger, it seems that when jQuery tries to open up the xhr, ie blocks it. The problem is, my page has a javascript src that points to bing maps js api (which of course is in a completely diffe...

How should I securely store passwords and use http auth in a chrome extension

I'm making a chrome extension that requires fetching an xml file from a secure server. I'm currently using XMLHttpRequest() to make a call to the server https://username:[email protected] which returns an xml object that I can parse and display. I want this extension to be available for more than just my hobby use, so it needs an...

How to create a dynamic xml which populates an advanced data grid in flex air application

Is it possible to create a dynamic xml file which changes in some fields to populate an advanced data grid? I have to display continents, countries, society and its values but i want to change randomly only the value and not all toegether... The client side application call the database by an asynchronous httpservice. LCDS, Blaze or simi...

XMLHTTPRequest.status returns 0 and responseText is blank in FireFox 3.5

I am trying to hit a third party URL to get the XML response and to show the reposne into my webpage. I get a proper response with status as 200 and readystate as 4 in IE and Safari browsers. But In FF3.5 and Crome i get XMLHTTPRequest status as 0 and reponseText comes as a blank string. I tried many options writing the normal XMLHTTPReq...

How To Use JQuery to Get XML From Remote REST API?

Hi there (& Happy New Year!) Are there some examples on how I can use JQUERY to get XML from a remote REST API and just display the XML? I just need a little assistance to get things going. Request Details: https://{username}:{password}@api.opsourcecloud.net/oec/0.9/myaccount Response Details: <?xml version="1.0" encoding="UTF-8" ...

XMLHttpRequest question

Hi, i have a php file on the server, it just prints random numbers. And i want to get this numbers by using XMLHttpRequest from another domain. how can i do this? thanks ...

Should I use an XMLHttpRequest /JSON or an iFrame?

I have been making extensive use of XMLHttpRequests and JSON to fetch from a MySQL database and return records as arrays. It works perfectly. Additionally, I have three cases in which I have the server (via PHP) formatting the data as a web page and creating bar charts (as opposed to sending arrays back to JavaScript for processing). Cu...

Getting output from server side python script

Hey, I'm doing this project where we are supposed to connect a javascript client side application/web page on server A with a python server side script on server B. I need to get the output from the python script and store it into a variable but am running into some problems. I was trying to use XMLHttpRequest for this, and even though ...

Firefox: Cross-domain requests with credentials return empty

Firefox send a cross-domain post with credentials, I can (using Charles - a proxy for HTTP debugging) see that the server is sending back the response… But Firefox isn't "letting me see it" (for lack of a better description). For example, using the documented example: >>> var invocation = new XMLHttpRequest(); >>> invocation.open('GET...

JSON and XMLHttpRequest ?

Question: I'm trying to use JSON, but all i find is JSON parsers, which I don't need... I've read that with JSON, you can do cross-domain requests. but all I see is implementations that use XMLHttpRequest... - which means you can't use cross-domain requests, at least not outside IE... I've been on http://www.json.org/, but all I find ...

XMLHttpRequest to get HTTP response from remote host

Why the following code Based on Mozilla example does not work? Tried with Firefox 3.5.7 & Chrome. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; <html> <head> </head> <body> </body> <script> var req = new XMLHttpRequest(); req.open('GET', 'http://www.mozilla.org/', fa...

iFrame access denied remote domain

How do i send a JavaScript function to an iframe with external content loaded, eg onclick="getElementByID('myiframe').src='fun();'" is there a way with ajax, i think XMLHttpRequest can help me. ...

Php reading xml in post request

So, I have perform two steps a) Create a some random xml file in one of the php file. b) Parse the same xml file in second file. Key points are that php file in a) will issue a post request to php file b) with only xml as its request. file b) will have to read the xml file using SImpleXml. I am trying to do something for this htt...

AJAX and Client-Server Architecture with JavaScript

I have to program websites, but I rather don't like the static HTML nature. I prefer more of a client-server architecture. Now I've figured, that with XMLhttp, you can basically dynamically update your page and send/request for information/action to/from a server. So this would basically cover the client area. But to complete a client-...

Prevent unnecessary HTTP requests for iPhone version of website

I have a website. It uses jQuery, a few plugins, Cufon, etc to spice things up a little, mostly visually. The iPhone version does not need any of these files. Can I, without resorting to subdomains, prevent the iPhone from loading these scripts? <script src="js/jquery-1.4.min.js" type="text/javascript"></script> <script src="js/browse...

AJAX request to get results from Google

I want to modify the code in this AJAX example to get results from Google. I take it out the line with the Random() method call, but how do I work with the query string in the JavaScript? How can I best do this using XMLHttpRequest to manually build the request (this is for testing so has to be manually done, as opposed to using a frame...