View Single Post
Old 02-04-2009, 03:50 PM   PM User | #1
gilgalbiblewhee
Regular Coder

 
Join Date: Mar 2005
Posts: 735
Thanks: 4
Thanked 1 Time in 1 Post
gilgalbiblewhee is an unknown quantity at this point
textarea word not appearing in the url through AJAX

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);
  }
}
__________________
Compare bible texts (and other tools):
TheWheelofGod
gilgalbiblewhee is offline   Reply With Quote