SEO | Link Popularity | Search Engine Consulting | SEO Tutorial | SEO Tools | SEO Forum
Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-15-2006, 09:22 PM
gilgalbiblewheel gilgalbiblewheel is offline
SEO Junior
 
Join Date: Sep 2004
Posts: 15 gilgalbiblewheel is on a distinguished road
Javascript problem in setting URL

Javascript problem in setting URL
I'm having difficulty in setting up the URL in by Javascript.
I have:
Code:
	<script language="JavaScript" type="text/javascript">
	<!--
function go1(Keyword,Keywordc,Keywordb,Keywordd,Keyworde,Ke  ywordf,Keywordg,Keywordh)
	{
	document.getElementById('ifrVerse').src='showverse  a.asp?id=' + document.bookSelect.id1.options[document.bookSelect.id1.selectedIndex].value + '&keyword=' + Keyword.replace(/[ ]/g,'+') + '&keywordc=' + Keywordc   

	}
function go2(Keyword,Keywordc,Keywordb,Keywordd,Keyworde,Ke  ywordf,Keywordg,Keywordh)
	{
	document.getElementById('ifrVerse2').src='showvers  ea.asp?id=' + document.bookSelectb.id2.options[document.bookSelectb.id2.selectedIndex].value + '&keyword=' + Keyword.replace(/[ ]/g,'+') + '&keywordc=' + Keywordc
	}

	//-->
	</script>


This is the URL I get:
/showversea.asp?id=8654&keyword=8654&keywordc=king

As you see 8654 is written twice. And king is bumped over to &keywordc. It should be with &keyword.

I have 2 forms:
Code:
	<form name="bookSelect" action="showversea.asp" method="get" target="ifrVerse">
	<select name="id1" id="id1" size="10" style="width:200;" onchange="go1(document.getElementById('id1').value,'<%=Keyword%>','<%=Keywordc%>');">

and
Code:
	<form name="bookSelectb" action="showversea.asp" method="get" target="ifrVerse2">
	<select name="id2" id="id2" size="10" style="width:200;" onchange="go2(document.getElementById('id2').value,'<%=Keyword%>','<%=Keywordc%>');">


The iFrames I have no problem with but here they are:
Code:
<iframe
src ="/wheelofgod/kjvresplistbox.asp"
width="300" height="1200" name="ifrVerse" id="ifrVerse">
</iframe>

</td>
<td>
<iframe
src ="/wheelofgod/kjvresplistbox.asp"
width="300" height="1200" name="ifrVerse2" id="ifrVerse2">
</iframe>
Reply With Quote
  #2  
Old 02-21-2006, 08:10 AM
abhishekmat's Avatar
abhishekmat abhishekmat is offline
SEO
 
Join Date: Nov 2004
Location: Bangalore, India
Posts: 381 abhishekmat will become famous soon enough
I am not able to find any problem in your code

Just added names for iframe. Add some items under your SELECT and check.

Here it is...
Code:
<html>
<title>
DO IT THIS WAY
</title>
<head>
<script language="JavaScript" type="text/javascript">
	<!--
function go1(Keyword,Keywordc,Keywordb,Keywordd,Keyworde,Ke    ywordf,Keywordg,Keywordh)
	{
	document.getElementById('ifrVerse').src='showverse    a.asp?id=' + document.bookSelect.id1.options[document.bookSelect.id1.selectedIndex].value + '&keyword=' + Keyword.replace(/[ ]/g,'+') + '&keywordc=' + Keywordc   
	}
function go2(Keyword,Keywordc,Keywordb,Keywordd,Keyworde,Ke    ywordf,Keywordg,Keywordh)
	{
	document.getElementById('ifrVerse2').src='showvers    ea.asp?id=' + document.bookSelectb.id2.options[document.bookSelectb.id2.selectedIndex].value + '&keyword=' + Keyword.replace(/[ ]/g,'+') + '&keywordc=' + Keywordc
	}

	//-->
	</script>
</head>
<body>
<form name="bookSelect" action="showversea.asp" method="get" target="ifrVerse">
<select name="id1" id="id1" size="10" style="width:200;" onchange="go1(document.getElementById('id1').value,'<%=Keyword%>','<%=Keywordc%>');">
</form>

<form name="bookSelectb" action="showversea.asp" method="get" target="ifrVerse2">
<select name="id2" id="id2" size="10" style="width:200;" onchange="go2(document.getElementById('id2').value,'<%=Keyword%>','<%=Keywordc%>');">
</form>

<iframe name="ifrVerse"
src ="/wheelofgod/kjvresplistbox.asp"
width="300" height="1200" name="ifrVerse" id="ifrVerse">
</iframe>

<iframe name="ifrVerse2"
src ="/wheelofgod/kjvresplistbox.asp"
width="300" height="1200" name="ifrVerse2" id="ifrVerse2">
</iframe>
</body>
</html>


Let me know ..

Abhishek
__________________
Package tour offers kerala tourism

Check Free Directory List
Reply With Quote
  #3  
Old 02-21-2006, 10:06 AM
gilgalbiblewheel gilgalbiblewheel is offline
SEO Junior
 
Join Date: Sep 2004
Posts: 15 gilgalbiblewheel is on a distinguished road
I did.
Code:
<select name="id1" id="id1" size="10" style="width:200;" onchange="go1(<%'identity',%>'<%=Keyword%>','<%=Keywordc%>');">

After knocking off <%'identity',%> everything came to place.
showversea.asp?id=8110&keyword=king&keywordc=for%20ever
Code:
	<script language="JavaScript" type="text/javascript">
	<!--
function go1(Keyword,Keywordc,Keywordb,Keywordd,Keyworde,Ke  ywordf,Keywordg,Keywordh)
	{
	document.getElementById('ifrVerse').src='showverse  a.asp?id=' + document.bookSelect.id1.options[document.bookSelect.id1.selectedIndex].value + '&keyword=' + Keyword.replace(/[ ]/g,'+') + '&keywordc=' + Keywordc; 
		}
function go2(Keyword,Keywordc,Keywordb,Keywordd,Keyworde,Ke  ywordf,Keywordg,Keywordh)
	{
	document.getElementById('ifrVerse2').src='showvers  ea.asp?id=' + document.bookSelectb.id2.options[document.bookSelectb.id2.selectedIndex].value + '&keyword=' + Keyword.replace(/[ ]/g,'+') + '&keywordc=' + Keywordc;
		}

	//-->
	</script>
Reply With Quote
  #4  
Old 11-02-2006, 04:40 AM
yaldex yaldex is offline
SEO Junior
 
Join Date: Nov 2006
Posts: 2 yaldex is on a distinguished road
Looks good - technically.

Did you try saving the values into variables first and then echoing them through a JavaScript alert() to see if they really contain what you expect them to contain?
__________________
Exellent JavaScript Debugger
Reply With Quote
Reply


Thread Tools
Display Modes 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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Login/Register
User Name
Password
Remember Me?

Forum Links
Forum Home
SEO Forum
Internet Marketing Forum
Web Design Forum
Web Hosting Forum
Programming Forum
SEO Chat

Quick Links
Forum Home
New Posts
Mark Forums Read
Open Buddy List
User Control Panel
Edit Avatar
Edit Profile
Edit Options
Miscellaneous
Subscribed Threads
My Profile

Search Forums

Advanced Search
All times are GMT -8. The time now is 08:15 AM.


Powered by: vBulletin Version 3.0.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.