Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forcing frames problem

Status
Not open for further replies.

Microbe

Programmer
Oct 16, 2000
607
AU
I have a bit of javascript that forces a page into a frameset if someone hits the page directly.



========================

function pushframes(Currentlocation)
{
document.write(&quot;<html><head><title>TITLE</title>\n&quot;);
document.write(&quot;<frameset cols='120,*' framespacing='0' border='false' frameborder='0'>\n&quot;);
document.write(&quot;<frame name='navbar' scrolling='no' src='navbar.htm'>\n&quot;);
document.write(&quot;<frame name='main' src='&quot; + Currentlocation + &quot;' scrolling='auto'>\n&quot;);
document.write(&quot;</frameset>\n&quot;);
document.write(&quot;</head>\n&quot;)
}


Currentlocation = document.location
if (self == top) {
pushframes(Currentlocation);
}
=====================================
It works beautifully...and is very useful...feel free to use it. I have it as a seperate file &quot;pushframe.js&quot; and call it as in the &quot;pagename.asp&quot; code below.

Except it doesn't work bautifully on one page in particular.

If I call &quot; directly where the opening code of pagename.asp is

====================
<%@LANGUAGE=&quot;VBSCRIPT&quot;%>
<script src=pushframe.js></script>
<%
if request.querystring(&quot;imageID&quot;) = &quot;&quot; then response.redirect &quot;default.asp&quot;
%>

<%
set imagebank = Server.CreateObject(&quot;ADODB.Recordset&quot;)
rs.ActiveConnection = &quot;dsn=eimage;&quot;
rs.Source = &quot;SELECT * FROM imagebank WHERE image_ID = '&quot; + Replace(request.querystring(&quot;imageID&quot;), &quot;'&quot;, &quot;''&quot;) + &quot;'&quot;
rs.CursorType = 0
rs.CursorLocation = 2
rs.LockType = 3
rs.Open
rs_numRows = 0
%>
<html>
<head>
<title>View individual image</title>
=========================
instead of pushing it into the frame, there is nothing in the frame except <html></html> No document reference or anything.

If I remove the &quot;?imageid=abc&quot; querystring and just use &quot; with no other changes at all, it works perfectly.

Can't for the life of me figure out why it breaks just because I have something in the querystring. FYI I have tried in in various combinations of frames and in different frames within the frameset with no luck. Run out of troubleshooting ideas.

Any thoughts?

Steve Davis
hey.you@hahaha.com.au
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top