Reputation: 17
I have been looking through different answers to what might be the same question I am asking, and a lot of the solutions have used PHP or JQuery and I have to do this in JavaScript. Here is my problem (and I'm a real noob, so I'm probably doing something really stupid and that's why it's not working).
I am trying to pass 'code' with a value in a query string appended to the URL. Then get the code to write dynamically to the page after. Right now, I'm receiving the error: "Incorrect code submitted". I don't think I am sending the "code" correctly.
I started a jsfiddle too: http://jsfiddle.net/shannongmac/6Z7NR/
Here is my code:
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");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","http://florence.ccs.uconn.edu/~adepalma/cgi-bin/iskm3120/response.cgi",true);
xmlhttp.send("yowza");
function addText() {
var newParagraph = document.createElement('p');
newParagraph.textContent = textArea.value;
document.getElementById("myDiv").insertBefore(newParagraph, H2);
}
}
Upvotes: 0
Views: 118
Reputation: 2016
You have a couple of problems with your code:
Upvotes: 1