We help IT Professionals succeed at work.

Ajax simple question

yjchong514
yjchong514 asked
on
Dear EE members,

I am new to AJAX and would like to test run the behavior of AJAX via the less1.html attached here. But , I hit the access denied error in  xmlHttp.open('GET','Content.html',false);

My browser is IE 8

Thanks.

Regards,

yjchong514
less1.html
Comment
Watch Question

USER jquery its simple.

$(document).ready(function () {

   $.get({
             'Content.html',
            success: function(msg){
document.getElementById('Family').innerHTML=msg
            }

            });
});
Fixer of Problems
CERTIFIED EXPERT
Most Valuable Expert 2014
Commented:
Nothing wrong with your code, it works fine if you run thru a web server.  IE might not like it if you run it as a file because IE will block the javascript or "active content" in local files.

Author

Commented:
Dear DaveBaldwin,

Thanks for your comment. I have attempted on Mozilla, the code works.

Regards,

yjchong514
Dave BaldwinFixer of Problems
CERTIFIED EXPERT
Most Valuable Expert 2014

Commented:
Glad to help.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.