Skip Menu |

This queue is for tickets about the CGI-Ajax CPAN distribution.

Report information
The Basics
Id: 15851
Status: resolved
Worked: 23 min
Priority: 0/
Queue: CGI-Ajax

People
Owner: bct [...] cpan.org
Requestors: tiny [...] timka.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.652
Fixed in: (no value)



Subject: An error in Opera
A small test script I wrote did not work in Opera. This is what JavaScript console showed: Event thread: click Error: name: TypeError message: Statement on line 88: Type mismatch (usually a non-object value used where an object is required) The cause of problem are these 2 lines of code in Ajax.pm: r.setRequestHeader('Cache-Control','no-cache'); and r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); because Opera (and I used 8.0) does not support a method setRequestHeader. So you should check for this method's support before calling it, like this: if (r.setRequestHeader) r.setRequestHeader('Cache-Control','no-cache');
Date: Wed, 16 Nov 2005 08:20:16 -0800
From: Brian Thomas <bct.x42 [...] gmail.com>
To: bug-CGI-Ajax [...] rt.cpan.org
Subject: Re: [cpan #15851] An error in Opera
RT-Send-Cc:
Hi Thanks for the input, but I'm having a problem recreating. I installed opera, and on 8.50, everything appears to be functioning. In your test script, are you using the POST or the default (GET) syntax for the CGI::Ajax method? Could you send your code, or more details of your code, so I can better test? Can you upgrade to 8.5? BCT On 11/16/05, Guest via RT <bug-CGI-Ajax@rt.cpan.org> wrote: Show quoted text
> > This message about CGI-Ajax was sent to you by guest <> via rt.cpan.org > > Full context and any attached attachments can be found at: > <URL: https://rt.cpan.org/Ticket/Display.html?id=15851 > > > A small test script I wrote did not work in Opera. This is what JavaScript console showed: > > Event thread: click > Error: > name: TypeError > message: Statement on line 88: Type mismatch (usually a non-object value used where an object is required) > > The cause of problem are these 2 lines of code in Ajax.pm: > > r.setRequestHeader('Cache-Control','no-cache'); > > and > > r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); > > because Opera (and I used 8.0) does not support a method setRequestHeader. So you should check for this method's support before calling it, like this: > > if (r.setRequestHeader) > r.setRequestHeader('Cache-Control','no-cache'); >
HI, I tried your script exactly as submitted in Opera 8.5 and it worked fine. I think the problem is your browser version. BCT