Can't Pass Query String

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • news-server.tampabay.rr.com

    #1

    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="JavaS cript">
    <!--

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

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

    // -->
    </SCRIPT>
    </HEAD>
    <SCRIPT LANGUAGE="JavaS cript">
    <!--

    document.write(
    '<frameset framespacing="0 " border="0" frameborder="0" rows="152,*">',
    '<frame name="toprow" scrolling="no" noresize target="maincon tent" src="',
    ar0, '" marginwidth="0" marginheight="0 ">',
    '<frameset cols="181, *">',
    '<frame name="leftcolum n" target="maincon tent" src="', ar1, '"
    marginwidth="0" marginheight="0 " scrolling="auto " noresize>',
    '<frame name="mainconte nt" 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="JavaS cript">
    <!--
    var sPath = window.location .pathname;
    //var sPage = sPath.substring (sPath.lastInde xOf('\\') + 1);
    var sPage = sPath.substring (sPath.lastInde xOf('/') + 1);

    if (top.location.h ref.indexOf("de fault.asp") == -1)
    top.location.hr ef = "default.as p?" + sPage + "&2";
    // -->
    </SCRIPT>

    Help would be greatly appreciated,
    Fox


  • Jeff North

    #2
    Re: Can't Pass Query String

    On Tue, 29 Mar 2005 18:21:32 GMT, in comp.lang.javas cript
    "news-server.tampabay .rr.com" <fox @ connexions.net> wrote:
    [color=blue]
    >| 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="JavaS cript">
    >| <!--
    >|
    >| var ar0 = "top.asp";
    >| var ar1 = "side.asp";
    >| var ar2 = "welcome.as p";[/color]

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

    [snip 2 end]
    ---------------------------------------------------------------
    jnorthau@yourpa ntsyahoo.com.au : Remove your pants to reply
    ---------------------------------------------------------------

    Comment

    • McKirahan

      #3
      Re: Can't Pass Query String

      "Jeff North" <jnorthau@yahoo .com.au> wrote in message
      news:3afk41llde lt0i84jad7nq78f 6n8v8n8pv@4ax.c om...
      [color=blue]
      > Try adding:
      > var ar2 = "welcome.asp?<% Request.QuerySt ring)";[/color]

      [snip]

      Don't you mean:

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


      Comment

      • Fox

        #4
        Re: Can't Pass Query String


        "McKirahan" <News@McKirahan .com> wrote in message
        news:Y4Wdnazej9 nVGNffRVn-gA@comcast.com. ..[color=blue]
        > "Jeff North" <jnorthau@yahoo .com.au> wrote in message
        > news:3afk41llde lt0i84jad7nq78f 6n8v8n8pv@4ax.c om...
        >[color=green]
        > > Try adding:
        > > var ar2 = "welcome.asp?<% Request.QuerySt ring)";[/color]
        >
        > [snip]
        >
        > Don't you mean:
        >
        > var ar2 = "welcome.asp?<% =Request.QueryS tring()%>";
        >
        >[/color]

        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="JavaS cript">
        <!--
        var sPath = window.location .pathname;
        //var sPage = sPath.substring (sPath.lastInde xOf('\\') + 1);
        var sPage = sPath.substring (sPath.lastInde xOf('/') + 1);

        if (top.location.h ref.indexOf("de fault.asp") == -1)
        top.location.hr ef = "default.as p?" + 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="JavaS cript">
        <!--

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

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

        // -->
        </SCRIPT>
        </HEAD>
        <SCRIPT LANGUAGE="JavaS cript">
        <!--

        document.write(
        '<frameset framespacing="0 " border="0" frameborder="0" rows="152,*">',
        '<frame name="toprow" scrolling="no" noresize target="maincon tent" src="',
        ar0, '" marginwidth="0" marginheight="0 ">',
        '<frameset cols="181, *">',
        '<frame name="leftcolum n" target="maincon tent" src="', ar1, '"
        marginwidth="0" marginheight="0 " scrolling="auto " noresize>',
        '<frame name="mainconte nt" 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


        Comment

        • Jeff North

          #5
          Re: Can't Pass Query String

          On Wed, 30 Mar 2005 04:54:21 -0600, in comp.lang.javas cript
          "McKirahan" <News@McKirahan .com> wrote:
          [color=blue]
          >| "Jeff North" <jnorthau@yahoo .com.au> wrote in message
          >| news:3afk41llde lt0i84jad7nq78f 6n8v8n8pv@4ax.c om...
          >|
          >| > Try adding:
          >| > var ar2 = "welcome.asp?<% Request.QuerySt ring)";
          >|
          >| [snip]
          >|
          >| Don't you mean:
          >|
          >| var ar2 = "welcome.asp?<% =Request.QueryS tring()%>";[/color]


          Yeah that too :-)

          ---------------------------------------------------------------
          jnorthau@yourpa ntsyahoo.com.au : Remove your pants to reply
          ---------------------------------------------------------------

          Comment

          Working...