[SGVLUG] AJAX problem

Jeff Keys jskeys at gmail.com
Wed Feb 7 13:18:21 PST 2007


XMLHttpRequest is subject to the browser's sandbox. I believe the URLs it
requests may need to be in the same domain as the calling script. That said,
you are somewhat at the mercy of the browser. I think Firefox just stops the
request and puts an error message in the Javascript console; Internet
Explorer puts up a warning dialog and will let the user override it.

Instead of a fully qualified host name, try a local one:
url='<http://www./><phpfilename>.php?
...';

jeff

On 2/7/07, Peter Fogg <peter.fogg at sbcglobal.net> wrote:
>
> Thanks for the response. The server is at a hosting company and I do
> not have access to any of the logs. There are no references to
> "file:///" anywhere in the code; the code in the JavaScript declaring
> the url for the request is:
> url='http://www.<domainname>/<phpfilename>.php? ...';. Isn't that a
> fully qualified host name?
>
> Today it is still the case that the AJAX works without problem here at
> my home but fails intermittently on computers elsewhere some of which
> are on slow pipes and some on T1 pipes.
>
> Peter -
>
> On Feb 6, 2007, at 10:49 AM, Claude Felizardo wrote:
>
> > On 2/6/07, Peter Fogg <peter.fogg at sbcglobal.net> wrote:
> >> I am involved in the development of a website that uses AJAX in
> >> several
> >> places. The site works without a problem on my several iMac OS 10x and
> >> Windows XP computers. However, the AJAX parts of the site do not work
> >> for several other people on their various Windows computers in their
> >> homes. In addition, some of them have experienced intermittent success
> >> with the AJAX.
> >>
> >>   This message appears: "Error: uncaught exception: Permission denied
> >> to
> >> call method XMLHttpRequest.open".
> >>
> >> Yes, the entire site, database, php files etc. is in the same domain.
> >>
> >> Any thoughts on this head-scratcher will be appreciated.
> >>
> >> Peter -
> >
> > Get the exact time for the errors then check your web server logs for
> > errors.  check both the access and error logs.
> >
> > A quick google search using your error text says to check to make sure
> > you don't have references to file:/// or not using a fully qualified
> > host name.  Also check for cross  domain scripting security issues.
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.sgvlug.net/pipermail/sgvlug/attachments/20070207/d8649573/attachment.html


More information about the SGVLUG mailing list