[Javascript] pb with httprequest and firefox

Alex Turner Alex.Turner at Project-Network.com
Wed Nov 29 03:34:51 CST 2006


Nick,
 
Is it possible that this is a reflection off the server - i.e. it is the server that is sending a 'not well formed' error back to the client.  The server script might be getting upset because in Firefox the JSON is not being created properly (maybe something is undefined in Firefox and not in IE).
 
My suggestion would be to get JMeter, and set it up as a proxy.  Then run the test through it and see what the conversation actually contains - then you will not be going off on a 'wild goose chase'.
 
If you are not familiar on how to do this - there is an article on http://nerds-central.blogspot.com/ detailing how to use JMeter as a proxy.  The direct link is http://nerds-central.blogspot.com/2006/08/pushing-envelope-with-jmeter.html.
 
Good Luck
 
AJ
 
www.cubicalland.com
 

________________________________

From: javascript-bounces at LaTech.edu on behalf of Nick Fitzsimons
Sent: Tue 28/11/2006 17:53
To: [JavaScript List]
Subject: Re: [Javascript] pb with httprequest and firefox



On 28 Nov 2006, at 16:55:39, Bernu Bernard wrote:

> Hi list,
>
> I'm using XMLHttpRequest to get data from the server.
> It works but on Firefox only I got errors.
> The data I get are kind of JSON : { "q" : "something" } that is 
> sent as text.
>
> I got the data in req.responseText but with an error :
>
> Error: not well-formed
> Source File: http://169.254.5.185/cgi-bin/mycgi
> Line: 1, Column: 1
> Source Code:
> {"q":""}^
>
> I could not figure out what to do.
>
> Any suggestions ?
>
> Bernard_______________________________________________

Hi Bernard,

It's very difficult to know what the problem could be from the 
information you give. It's as if I said "I tried to go somewhere in 
my car, but I didn't get there; what might the problem be?" Answers 
could range from "You have no petrol" to "The road is closed" to "You 
were struck by a meteorite on the way" to "You found your car had 
been stolen when you went to start the journey" to... just about 
anything. It's difficult even to offer a guess as to a solution; 
continuing my example, suggesting I take a bus might help if the car 
was stolen or had no petrol, but not if the road was closed.

It would help us to help you if you could put a page containing just 
the code that isn't working correctly on a web server somewhere so 
people can try various tests. If that's not possible, then posting 
the code to the list will give somebody the chance to have a look and 
maybe test it out, to see if they can find the problem.

Having said that, the 'Not well formed" error might be something to 
do with Firefox trying to look at the data as XML. Make sure that 
your CGI is setting an HTTP Content-Type header of "application/
json", or at least anything but an XML content type, and also make 
sure that your script isn't trying to access the response through the 
req.responseXML property, as either of those might trigger such an 
error. Firefox tends to be much stricter about making sure things 
like that are correct; Internet Explorer tends to not bother telling 
you about such errors.

Regards,

Nick.
--
Nick Fitzsimons
http://www.nickfitz.co.uk/



_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 7485 bytes
Desc: not available
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20061129/9c6ca1ba/attachment.bin>


More information about the Javascript mailing list