posted on Aug, 9 2015 @ 12:11 PM
I have developed several websites in HTML5 and styled in CSS3. Now i have decided its time to really learn _javascript. I already started by visiting
W3 Schools and checking out their material.
I would like to ask some questions about this script. I see ATS strips doctype and script tags, I pasted it inside < code > < / code > hoping the
server would leave it intact. Oh well shouldn't hurt anything.
< code >
< !DOCTYPE html > //index.html
< html >
< head >
< script >
function loadXMLDoc()
[
var xmlhttp;
if (window.XMLHttpRequest)
[// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
]
else
[// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); //Depreciated browser support
]
xmlhttp.onreadystatechange=)
[
if (xmlhttp.readyState==4 && xmlhttp.status==200) //Scripts waits for ready status from server
[
document.get("myDiv").=xmlhttp.responseText; //Script creates < div > response data < /div >
]
]
xmlhttp.open("GET","demo_get.asp",true); //"GET","demo_get.asp" Can be "GET",animated_object1.html"?
xmlhttp.send();
]
< /script >
< /head >
< body >
< h2 >AJAX< /h2 >
< button type="button" onclick="loadXMLDoc()">Request data< /button > //Loads animated_object1.html into myDiv. Use css in the
< div id="myDiv">< /div > //template page to style the div size and
look?
< /body >
< /html >
< /code >
Please read the comments in the code and tell me if i am on the right track.