The simple answer is that you can't make Ajax calls to a file
resource.  Apache httpd is fairly easy to install (http://
httpd.apache.org)--or check your distro if you're running Linux.  If
you're using a pro version of Windows, you can also enable IIS or
PWS.  (There are also simpler lightweight httpd servers out there, but
I don't run those, so I can't speak for them. :-) )

There are ways to possibly get around that, but if your goal is to
test Ajax operating properly, I suggest setting up a simple web server
for your purposes.  Otherwise, you may end up expending debugging time
on something that will never come into play.

~Pyro

On May 22, 4:56 am, John <[EMAIL PROTECTED]> wrote:
> Hello.
> I'm fairly new to JQuery. In my learning I'm testing out very simple
> Ajax. I'm just trying to inject a small piece of HTML into a div in my
> current page.
> I get the same error every time.
>
> Permission denied to call method XMLHttpRequest.open
>  xml.open(s.type, s.url, s.async);
>
> I've read several post here and I understand that this is some
> limitation of Javascript or AJAX and cross domain stuff. But that IE
> allows it. Or something to that affect.
>
> But I'm just trying to get it to work locally. On my computer, working
> with files in the same folder. I've haven't found any post with
> anything this simple so I'm having trouble finding a solution.
>
> Any help would be great. I'm just trying to learn the basics before I
> try and master using server side scripting to grab cross domain pages
> and then load them through AJAX and all that jazz.
>
> Here's an example:
> //     JQuery
> $(document).ready(function(){
>    $("#ajax").click(function(){
>      $("#text").load("a.html");
>    });
>
> });
>
> <!-- HTML -->
> <p id="ajax">Ajax</p>
>
> <div id="text">
> <p />Hope this works
> </div>
>
> <!-- Chunk of HTML from a.html -->
> <p />All Kinds of Stufff
> <p />More stuff

Reply via email to