Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
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
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:22 PM.


Advertisement
Log in to turn off these ads.