ajax with JavaScript exception: unexpected end of input


I hv an input field for a logic and when the member fills it out he has to then checkout if the logic exists. So I made a checkout button which checks a DB using ajax and JavaScript to see if the logic exists. My issue is when using ajax and JavaScript I get this exception:
unexpected end of input
JS :
var logic = document.getElementById('acConceptName').value;
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange=function(){
if(xmlhttp.readyState==4 && xmlhttp.status==200){
var isexisted = JSON.parse(xmlhttp.responseText);
if(isexisted0==true){
var errorMessage = document.getElementById('acSuggesConcepts');
var p = document.createElement('p');
p.innerHTML="this logic is already existed";
errorMessage.appendChild(p);
errorMessage.style.display="block";
}
}
}
xmlhttp.open("GET" "http://localhost/Mar7ba/Ontology/isExistedConcept/"+concept+"/TRUE" true);
xmlhttp.send();

what's the exception and How do I fix it ?
PHP : function to checkout DB and I generally return true in it
public function isExistedConcept($concpetName $Ajax){
if($Ajax==true){
$results=true
$d=array($results);
return json_encode($d);
}
}

Demo: http://jsfiddle.net/Wiliam_Kinaan/s7Srx/2/



Get Source Code

  Views 160   Posted on : Wednesday, March 13, 2013 11:17:48 AM
Related Tags:




Replies on "ajax with JavaScript exception: unexpected end of input" :

Nobody has replied on this post , be first to post answer.


Post Your Answer/Comment:

Please Login first to post Reply !


Note: Please Put Code into <code></code> block.




Also See: