I used AJAX in this link:
http://www.iusedtoloveher.com/wheelofgod/
You have to go open the navigation box on the top left (sorry I have to simplify this in the future!) and then click the third link
Compare Two Bible Texts. Once you enter a word in the first
textarea and select the
book,
chapter, and
verse it doesn't record it in the
textbox underneath the verse dropdown select.
Anything wrong with this AJAX code?
Code:
function fillText1(){
var req = createRequest();
if(req){
req.onreadystatechange = function(){
var c = document.getElementById('seltext1');
if(req.readyState){
if(req.readyState == 4){
if(req.status == 200){
c.innerHTML = req.responseText;
}
}
}
}
var bobj = document.getElementById('selbook1');
//var book = bobj.options[bobj.selectedIndex].value;
var book = bobj.value;
var cobj = document.getElementById('selchapter1');
//var chapter = cobj.options[cobj.selectedIndex].value;
var chapter = cobj.value;
var vobj = document.getElementById('selverse1');
//var verse = vobj.options[vobj.selectedIndex].value;
var verse = vobj.value;
var getFullURL = 'twotexts/getText1.php?book='+book+'&chapter='+chapter+'&verse='+verse;
for(i=0;i<5;i++){
//if(key.value!=0){
getFullURL = getFullURL + '&keyword' + i + '=' + document.getElementById('keyword'+i).innerHTML;
//}
}
//document.write(getFullURL);
req.open('GET',getFullURL,true);
req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
req.send(null);
}
}