Jump to content

[SOLVED] ajax related javascript error


michaellunsford

Recommended Posts

I've googled this, but I just can't figure out what in the world it could be.

 

Firefox says: Object cannot be created in this context" code: "9

 

the code responsible is the "http.send();":

function sndReq(action) {
  http.open('get', 'imagelist.php?action='+(action?action:""));
  http.onreadystatechange = handleResponse;
  http.send();
}

 

if you want to see it in action, you can do so here:

http://68.228.8.85/timesphotocontest/

 

What is this error, and how do I make it go away?

Link to comment
https://forums.phpfreaks.com/topic/80058-solved-ajax-related-javascript-error/
Share on other sites

  • 4 weeks later...

I've googled this, but I just can't figure out what in the world it could be.

 

Firefox says: Object cannot be created in this context" code: "9

 

the code responsible is the "http.send();":

function sndReq(action) {
   http.onreadystatechange = handleResponse;
  http.send();
}

 

if you want to see it in action, you can do so here:

http://68.228.8.85/timesphotocontest/

 

What is this error, and how do I make it go away?

 

 

Hello ,

 

kindly check  http.open('get', 'imagelist.php?action='+(action?action:"")); line of code for proper formation of URL and secondly, when we make a get request write http.send(null).

 

Regards

 

Thanks for the reply, but I've still got the same error.

 

kindly check  http.open('get', 'imagelist.php?action='+(action?action:"")); line of code for proper formation of URL

 

yes, it is properly formed. if it was not, i would think no images would show up on the page at all. In fact, if I put a complete URL (not the IP address) I get Permission denied to call method XMLHttpRequest.open, and no images appear.

 

and secondly, when we make a get request write http.send(null).

 

Adding "null" is just like leaving it blank. Just for fun, I added "null" and I continue to get "Object cannot be created in this context"

 

I've also re-lived the page so you can see what it's doing.

http://68.228.8.85/timesphotocontest/

 

Thanks,

hello dear,

 

I was debugging the issue and i see some detailed error

 

Error: uncaught exception: [Exception... "Object cannot be created in this context"  code: "9" nsresult: "0x80530009 (NS_ERROR_DOM_NOT_SUPPORTED_ERR)"  location: "http://content.gannettonline.com/global/s_code/s_code.js Line: 446"]

 

kindly in to s_code.js.I think you should try to remove error with s

i.e

s has no properties

http://www.timesofacadiana.com/scripts/s_local_customization.js

Line 2

 

there is something related with this s.

kindly share if you are able to solve or else let me know what this 's' is all about which is causing second error.

 

regards

Wow, I can't believe it. That second error is related to a poorly written, commercial code from omniture site catalyst to track site traffic. It's removal has resolved the problem with the ajax code. There must be a collision with a variable somewhere.

 

Well, at least that settles the problem and I know where to look. I guess I'll rename all the variables and functions and see where that takes me.

 

Thanks for the help!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.