Connecting Tech Pros Worldwide Forums | Help | Site Map

XMLHttpRequest post hangs on Firefox / Mozilla

Jim Lawton
Guest
 
Posts: n/a
#1: Nov 30 '05

Hello, the following bit of (stripped down) code works fine in IE, but on Gecko
based browsers -
Firefox 1.0.7
Mozilla 1.7.12

it just hangs on the xmlhttpOpen

// IE object - works fine
// var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")

var xmlhttp =new XMLHttpRequest();
xmlhttp.Open("POST","http://www.anythin.com",false);

xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");

xmlhttp.send("data");

I'd be grateful for any ideas.

Cheers
--
Jim
a Yorkshire polymoth

cicap
Guest
 
Posts: n/a
#2: Nov 30 '05

re: XMLHttpRequest post hangs on Firefox / Mozilla



"Jim Lawton" <usenet1@jimlawton.TAKEOUTinfo> ha scritto nel messaggio
news:f17ro15qn3bdj0m74e3j0ff1fak1jj6kit@4ax.com...[color=blue]
>
> Hello, the following bit of (stripped down) code works fine in IE, but on
> Gecko
> based browsers -
> Firefox 1.0.7
> Mozilla 1.7.12
>
> it just hangs on the xmlhttpOpen
>
> // IE object - works fine
> // var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
>
> var xmlhttp =new XMLHttpRequest();
> xmlhttp.Open("POST","http://www.anythin.com",false);
>
> xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
>
> xmlhttp.send("data");
>
> I'd be grateful for any ideas.
>[/color]

What is the problem?


Martin Honnen
Guest
 
Posts: n/a
#3: Nov 30 '05

re: XMLHttpRequest post hangs on Firefox / Mozilla




Jim Lawton wrote:

[color=blue]
> var xmlhttp =new XMLHttpRequest();
> xmlhttp.Open("POST","http://www.anythin.com",false);[/color]

JavaScript is case sensitive so use
xmlhttp.open("POST", "url", false);
and I guess all is fine. Check the JavaScript console for error messages
if you still have problems. You need to be aware too that script in a
HTML document loaded via HTTP can with normal security settings only
connect back to the HTTP server the HTML document has been loaded from.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jim Lawton
Guest
 
Posts: n/a
#4: Nov 30 '05

re: XMLHttpRequest post hangs on Firefox / Mozilla


On Wed, 30 Nov 2005 14:04:39 +0100, Martin Honnen <mahotrash@yahoo.de> wrote:
[color=blue]
>
>
>Jim Lawton wrote:
>
>[color=green]
>> var xmlhttp =new XMLHttpRequest();
>> xmlhttp.Open("POST","http://www.anythin.com",false);[/color]
>
>JavaScript is case sensitive so use
> xmlhttp.open("POST", "url", false);
>and I guess all is fine. Check the JavaScript console for error messages
>if you still have problems. You need to be aware too that script in a
>HTML document loaded via HTTP can with normal security settings only
>connect back to the HTTP server the HTML document has been loaded from.[/color]


Yup - you got it. I was using Venkman, and developed blinkers. Because
everything was working fine in IE I was looking in the wrong place.

I'll have to pass the remote data through my "home" server.

Cheers, thanks for the help...
--
Jim
a Yorkshire polymoth
Closed Thread