ajax with JavaScript exception: unexpected end of input

This forum was posted on Wednesday, March 13, 2013 11:17:48 AM

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();
if(xmlhttp.readyState==4 && xmlhttp.status==200){
var isexisted = JSON.parse(xmlhttp.responseText);
var errorMessage = document.getElementById('acSuggesConcepts');
var p = document.createElement('p');
p.innerHTML="this logic is already existed";
xmlhttp.open("GET" "http://localhost/Mar7ba/Ontology/isExistedConcept/"+concept+"/TRUE" true);

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){
return json_encode($d);

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

 Views 173 Get Source Code >>
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.

Threads related to "ajax with JavaScript exception: unexpected end of input":