 |

02-15-2006, 10:23 PM
|
|
SEO Junior
|
|
Join Date: Sep 2004
Posts: 15
|
|
|
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>
|

02-21-2006, 09:11 AM
|
 |
SEO
|
|
Join Date: Nov 2004
Location: Bangalore, India
Posts: 386
|
|
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
|

02-21-2006, 11:06 AM
|
|
SEO Junior
|
|
Join Date: Sep 2004
Posts: 15
|
|
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>
|

11-02-2006, 05:40 AM
|
|
SEO Junior
|
|
Join Date: Nov 2006
Posts: 2
|
|
|
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?
|
 |
| Thread Tools |
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|