I have a bit of javascript that forces a page into a frameset if someone hits the page directly.
========================
function pushframes(Currentlocation)
{
document.write("<html><head><title>TITLE</title>\n"
document.write("<frameset cols='120,*' framespacing='0' border='false' frameborder='0'>\n"
document.write("<frame name='navbar' scrolling='no' src='navbar.htm'>\n"
document.write("<frame name='main' src='" + Currentlocation + "' scrolling='auto'>\n"
document.write("</frameset>\n"
document.write("</head>\n"
}
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 "pushframe.js" and call it as in the "pagename.asp" code below.
Except it doesn't work bautifully on one page in particular.
If I call " directly where the opening code of pagename.asp is
====================
<%@LANGUAGE="VBSCRIPT"%>
<script src=pushframe.js></script>
<%
if request.querystring("imageID" = "" then response.redirect "default.asp"
%>
<%
set imagebank = Server.CreateObject("ADODB.Recordset"
rs.ActiveConnection = "dsn=eimage;"
rs.Source = "SELECT * FROM imagebank WHERE image_ID = '" + Replace(request.querystring("imageID", "'", "''" + "'"
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 "?imageid=abc" querystring and just use " 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
========================
function pushframes(Currentlocation)
{
document.write("<html><head><title>TITLE</title>\n"
document.write("<frameset cols='120,*' framespacing='0' border='false' frameborder='0'>\n"
document.write("<frame name='navbar' scrolling='no' src='navbar.htm'>\n"
document.write("<frame name='main' src='" + Currentlocation + "' scrolling='auto'>\n"
document.write("</frameset>\n"
document.write("</head>\n"
}
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 "pushframe.js" and call it as in the "pagename.asp" code below.
Except it doesn't work bautifully on one page in particular.
If I call " directly where the opening code of pagename.asp is
====================
<%@LANGUAGE="VBSCRIPT"%>
<script src=pushframe.js></script>
<%
if request.querystring("imageID" = "" then response.redirect "default.asp"
%>
<%
set imagebank = Server.CreateObject("ADODB.Recordset"
rs.ActiveConnection = "dsn=eimage;"
rs.Source = "SELECT * FROM imagebank WHERE image_ID = '" + Replace(request.querystring("imageID", "'", "''" + "'"
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 "?imageid=abc" querystring and just use " 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