473,387 Members | 3,787 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Can't Pass Query String

Hi,

Below is a stock script I found which controls a framed environment.
My problem is that if a URL has a query string attached, that string
does not pass through. Can someone please let me know if and
hopefully how, it will be possible to carry a query string through?

This first part here is in the default.asp framed page.

<SCRIPT LANGUAGE="JavaScript">
<!--

var ar0 = "top.asp";
var ar1 = "side.asp";
var ar2 = "welcome.asp";

var str = location.search;
var pos = str.indexOf("&");
if (pos != -1) {
var num = str.substring(pos + 1, str.length);
window["ar" + num] = str.substring(1, pos);
}

// -->
</SCRIPT>
</HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--

document.write(
'<frameset framespacing="0" border="0" frameborder="0" rows="152,*">',
'<frame name="toprow" scrolling="no" noresize target="maincontent" src="',
ar0, '" marginwidth="0" marginheight="0">',
'<frameset cols="181, *">',
'<frame name="leftcolumn" target="maincontent" src="', ar1, '"
marginwidth="0" marginheight="0" scrolling="auto" noresize>',
'<frame name="maincontent" src="', ar2, '" marginwidth="0"
marginheight="0" scrolling="auto">',
'</FRAMESET>',
'</FRAMESET>'
);

// -->
</SCRIPT>

Then for any page to appear in the frames
this script is used in that page. But if that
page is called with a query string attached
that string will not pass through without
adjustments that I do not know how to
deal with in either page.

<SCRIPT LANGUAGE="JavaScript">
<!--
var sPath = window.location.pathname;
//var sPage = sPath.substring(sPath.lastIndexOf('\\') + 1);
var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);

if (top.location.href.indexOf("default.asp") == -1)
top.location.href = "default.asp?" + sPage + "&2";
// -->
</SCRIPT>

Help would be greatly appreciated,
Fox
Jul 23 '05 #1
4 4791
On Tue, 29 Mar 2005 18:21:32 GMT, in comp.lang.javascript
"news-server.tampabay.rr.com" <fox @ connexions.net> wrote:
| Hi,
|
| Below is a stock script I found which controls a framed environment.
| My problem is that if a URL has a query string attached, that string
| does not pass through. Can someone please let me know if and
| hopefully how, it will be possible to carry a query string through?
|
| This first part here is in the default.asp framed page.
|
| <SCRIPT LANGUAGE="JavaScript">
| <!--
|
| var ar0 = "top.asp";
| var ar1 = "side.asp";
| var ar2 = "welcome.asp";


Try adding:
var ar2 = "welcome.asp?<%Request.QueryString)";

[snip 2 end]
---------------------------------------------------------------
jn******@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Jul 23 '05 #2
"Jeff North" <jn******@yahoo.com.au> wrote in message
news:3a********************************@4ax.com...
Try adding:
var ar2 = "welcome.asp?<%Request.QueryString)";


[snip]

Don't you mean:

var ar2 = "welcome.asp?<%=Request.QueryString()%>";
Jul 23 '05 #3
Fox

"McKirahan" <Ne**@McKirahan.com> wrote in message
news:Y4********************@comcast.com...
"Jeff North" <jn******@yahoo.com.au> wrote in message
news:3a********************************@4ax.com...
Try adding:
var ar2 = "welcome.asp?<%Request.QueryString)";


[snip]

Don't you mean:

var ar2 = "welcome.asp?<%=Request.QueryString()%>";


I see I did not explain well enough. Thanks, that one
does work, but that is not where my problem is.

My problem is when calling an orphan page with
a URL and query. That orphan page will show up
in the frames as it is supposed to as a child, but the
query is no more.

I need to be able to carry the query from the orphan
to the parent, so that the orphan, when a child,
still has the query value available within it.
This is the script in the orphan pages which makes
them becomes children of the frames when accessed.
When I access them with a query I need that query
to get written into the Javascript so that it can then
become a variable in the parent frame page (default.asp)
I have tried many things and read many web pages but
cannot seem to get the relationship and syntax needed.

<SCRIPT LANGUAGE="JavaScript">
<!--
var sPath = window.location.pathname;
//var sPage = sPath.substring(sPath.lastIndexOf('\\') + 1);
var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);

if (top.location.href.indexOf("default.asp") == -1)
top.location.href = "default.asp?" + sPage + "&2";
// -->
</SCRIPT>

Here again is the script in the framed page, which
needs to read and use the Query String in the
third frame or as it is in the script AR2.

<SCRIPT LANGUAGE="JavaScript">
<!--

var ar0 = "top.asp";
var ar1 = "side.asp";
var ar2 = "welcome.asp";

var str = location.search;
var pos = str.indexOf("&");
if (pos != -1) {
var num = str.substring(pos + 1, str.length);
window["ar" + num] = str.substring(1, pos);
}

// -->
</SCRIPT>
</HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--

document.write(
'<frameset framespacing="0" border="0" frameborder="0" rows="152,*">',
'<frame name="toprow" scrolling="no" noresize target="maincontent" src="',
ar0, '" marginwidth="0" marginheight="0">',
'<frameset cols="181, *">',
'<frame name="leftcolumn" target="maincontent" src="', ar1, '"
marginwidth="0" marginheight="0" scrolling="auto" noresize>',
'<frame name="maincontent" src="', ar2, '" marginwidth="0"
marginheight="0" scrolling="auto">',
'</FRAMESET>',
'</FRAMESET>'
);

// -->
</SCRIPT>

If you can still help me it would be greatly
appreciated. I built alot around this and
am sort of stuck having to solve it.

Regards,
Fox
Jul 23 '05 #4
On Wed, 30 Mar 2005 04:54:21 -0600, in comp.lang.javascript
"McKirahan" <Ne**@McKirahan.com> wrote:
| "Jeff North" <jn******@yahoo.com.au> wrote in message
| news:3a********************************@4ax.com...
|
| > Try adding:
| > var ar2 = "welcome.asp?<%Request.QueryString)";
|
| [snip]
|
| Don't you mean:
|
| var ar2 = "welcome.asp?<%=Request.QueryString()%>";

Yeah that too :-)

---------------------------------------------------------------
jn******@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Matt | last post by:
In ASP, when we pass data between pages, we usually pass by query string. If we pass data by query string, that means we need to use submit button, not by regular button, and the form will pass to...
3
by: Robert | last post by:
I am having performance issues on a SQL query in Access. My query is accessing and joining several tables (one very large one). The tables are linked ODBC. The client submits the query to the...
4
by: Corey | last post by:
All, I am relatively new to XML and I have what may sound like a dumb question. I want to pass a query string variable to my xml document and filter the output based on that variable. For...
5
by: Don Seckler | last post by:
I have an update query that runs when a report closes. I have several reports that will need to run the update query with diferent criteria. I'd like to simply make the criteria change in the...
2
by: Robert | last post by:
when using the following function to create a pass through query is there a way to set the query property, "Returns Rows" to no. The default is yes. Since we are planning to create the pass...
1
by: Greg Strong | last post by:
Hello All, Why would brackets be added to the SQL of a pass through query to Oracle? If I paste the debug print of the SQL statement into SQLPlus of Oracle's XE edition it works, and does NOT...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
5
by: dkintheuk | last post by:
Is it possible to set (using VBA) the rowsource for a combo box but have that rowsource come from a pass-through query. I can obviously manually go into the rowsource property and define the...
3
by: Tim Sprout | last post by:
I want button1_Click on Form1 to send a query using the textBox1.Text string as part of the query. I want to populate a dataGridView from an Access database file. I am trying to build a search box...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.