Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-18-2012, 09:42 AM   PM User | #1
angelcoder
New to the CF scene

 
Join Date: May 2012
Location: Bangalore, India
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
angelcoder is an unknown quantity at this point
My AJAX code is not running

my ajax code is not running!!
function loadXMLDoc(){
var xmlhttp;
if(window.XMLHttpRequest) {
xmlhttp= new XMLHttpRequest();
}
else {
xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
}
if(xmlhttp) {
xmlhttp.open("GET", "../NewProject/WebContent/html/ajax_info.html", true);
xmlhttp.onreadystatechange= onReadyState;
function onReadyState(){
if(xmlhttp.readyState==4 && xmlhttp.status ==200){
document.getElementById("myDiv").innerHTML = xmlhttp.responseText;
}
xmlhttp.send();
}
}
}

internet explorer says access denied at the line -
xmlhttp.open("GET", "../NewProject/WebContent/html/ajax_info.html", true);
angelcoder is offline   Reply With Quote
Old 05-18-2012, 01:51 PM   PM User | #2
DaveyErwin
Regular Coder

 
Join Date: Aug 2010
Posts: 810
Thanks: 12
Thanked 168 Times in 166 Posts
DaveyErwin is on a distinguished road
you have a typo here

document.getElementById("myDiv").innerHTML = xmlhttp.responseText;
}
xmlhttp.send();
}
}
}
should be …
document.getElementById("myDiv").innerHTML = xmlhttp.responseText;
}
}
xmlhttp.send();

}
}
But your problem is you don't
have permission to access
the file ajax_info.html,
what server are you using ?
DaveyErwin is offline   Reply With Quote
Old 05-21-2012, 06:31 AM   PM User | #3
angelcoder
New to the CF scene

 
Join Date: May 2012
Location: Bangalore, India
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
angelcoder is an unknown quantity at this point
Unhappy

the code doesn't work on internet explorer.. it says access denied...
angelcoder is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:40 AM.


Advertisement
Log in to turn off these ads.