Choose code to run based on incoming URL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Howard Kaikow

    Choose code to run based on incoming URL

    Can I use a bookmark to selectively choose the code to be run?



    For example. Suppose we have the following in an HTML file:



    <html>

    <head>

    <script language="JavaS cript"><!--

    location.href = 'HKlinks.html#B '

    //--></script>

    <noscript>

    <meta http-equiv="Refresh" content="3;url= HowardKaikowSer vices.html">

    </noscript>

    </head>

    </html>



    And hklinks.html has:



    <html>

    <head>

    <a name="A"><scrip t language="JavaS cript"><!--

    location.href = 'HowardKaikow.h tml'

    //--></script></a>

    <a name="B"><scrip t language="JavaS cript"><!--

    location.href = HowardKaikowSer vices.html'

    //--></script></a>

    <noscript>

    <meta http-equiv="Refresh" content="3;url= index.html">

    </noscript>

    </head>

    </html>



    I want to choose which javascript to run based on the incoming link.

    I tried onload.target to choose, but I think I screwed up the sintax.


    --
    http://www.standards.com/; See Howard Kaikow's web site.


  • McKirahan

    #2
    Re: Choose code to run based on incoming URL

    "Howard Kaikow" <kaikow@standar ds.com> wrote in message
    news:ck38sp$57t $1@pyrite.mv.ne t...[color=blue]
    > Can I use a bookmark to selectively choose the code to be run?
    >
    >
    >
    > For example. Suppose we have the following in an HTML file:
    >
    >
    >
    > <html>
    >
    > <head>
    >
    > <script language="JavaS cript"><!--
    >
    > location.href = 'HKlinks.html#B '
    >
    > //--></script>
    >
    > <noscript>
    >
    > <meta http-equiv="Refresh" content="3;url= HowardKaikowSer vices.html">
    >
    > </noscript>
    >
    > </head>
    >
    > </html>
    >
    >
    >
    > And hklinks.html has:
    >
    >
    >
    > <html>
    >
    > <head>
    >
    > <a name="A"><scrip t language="JavaS cript"><!--
    >
    > location.href = 'HowardKaikow.h tml'
    >
    > //--></script></a>
    >
    > <a name="B"><scrip t language="JavaS cript"><!--
    >
    > location.href = HowardKaikowSer vices.html'
    >
    > //--></script></a>
    >
    > <noscript>
    >
    > <meta http-equiv="Refresh" content="3;url= index.html">
    >
    > </noscript>
    >
    > </head>
    >
    > </html>
    >
    >
    >
    > I want to choose which javascript to run based on the incoming link.
    >
    > I tried onload.target to choose, but I think I screwed up the sintax.
    >
    >
    > --
    > http://www.standards.com/; See Howard Kaikow's web site.
    >
    >[/color]

    How about the following instead?

    <html>
    <head>
    <script type="text/javascript">
    location.href = "HKlinks.html?B ";
    </script>
    <noscript>
    <meta http-equiv="Refresh" content="3;url= HowardKaikowSer vices.html">
    </noscript>
    </head>
    </html>


    <html>
    <head>
    <script type="text/javascript">
    var loc = location.search ;
    if (loc == "?A") location.href = "HowardKaikow.h tml";
    if (loc == "?B") location.href = "HowardKaikowSe rvices.html";
    </script>
    <noscript>
    <meta http-equiv="Refresh" content="3;url= index.html">
    </noscript>
    </head>
    </html>


    Comment

    • Michael Winter

      #3
      Re: Choose code to run based on incoming URL

      On Thu, 07 Oct 2004 11:50:34 GMT, McKirahan <News@McKirahan .com> wrote:

      [snip]
      [color=blue][color=green]
      >> I want to choose which javascript to run based on the incoming link.[/color][/color]

      [snip]
      [color=blue]
      > How about the following instead?[/color]

      Since we're only talking about redirection, why not do it the proper way.
      With the server.

      [snip]

      Mike


      Please trim quotes!

      --
      Michael Winter
      Replace ".invalid" with ".uk" to reply by e-mail.

      Comment

      • Howard Kaikow

        #4
        Re: Choose code to run based on incoming URL

        "Michael Winter" <M.Winter@bluey onder.co.invali d> wrote in message
        news:opsfh00z0b x13kvk@atlantis ...[color=blue]
        > On Thu, 07 Oct 2004 11:50:34 GMT, McKirahan <News@McKirahan .com> wrote:
        >
        > [snip]
        >[color=green][color=darkred]
        > >> I want to choose which javascript to run based on the incoming link.[/color][/color]
        >
        > [snip]
        >[color=green]
        > > How about the following instead?[/color]
        >
        > Since we're only talking about redirection, why not do it the proper way.
        > With the server.[/color]

        Because my ISP limits what we can do and even then discourages server side
        stuff.

        I could use a custom 404 file, but I want to try javascript first.[color=blue]
        >
        > [snip]
        >
        > Mike
        >
        >
        > Please trim quotes!
        >
        > --
        > Michael Winter
        > Replace ".invalid" with ".uk" to reply by e-mail.[/color]


        Comment

        • Howard Kaikow

          #5
          Re: Choose code to run based on incoming URL

          Thanx, I'll give it a try.

          --
          http://www.standards.com/; See Howard Kaikow's web site.
          "McKirahan" <News@McKirahan .com> wrote in message
          news:e4a9d.2048 33$D%.55378@att bi_s51...[color=blue]
          > "Howard Kaikow" <kaikow@standar ds.com> wrote in message
          > news:ck38sp$57t $1@pyrite.mv.ne t...[color=green]
          > > Can I use a bookmark to selectively choose the code to be run?
          > >
          > >
          > >
          > > For example. Suppose we have the following in an HTML file:
          > >
          > >
          > >
          > > <html>
          > >
          > > <head>
          > >
          > > <script language="JavaS cript"><!--
          > >
          > > location.href = 'HKlinks.html#B '
          > >
          > > //--></script>
          > >
          > > <noscript>
          > >
          > > <meta http-equiv="Refresh" content="3;url= HowardKaikowSer vices.html">
          > >
          > > </noscript>
          > >
          > > </head>
          > >
          > > </html>
          > >
          > >
          > >
          > > And hklinks.html has:
          > >
          > >
          > >
          > > <html>
          > >
          > > <head>
          > >
          > > <a name="A"><scrip t language="JavaS cript"><!--
          > >
          > > location.href = 'HowardKaikow.h tml'
          > >
          > > //--></script></a>
          > >
          > > <a name="B"><scrip t language="JavaS cript"><!--
          > >
          > > location.href = HowardKaikowSer vices.html'
          > >
          > > //--></script></a>
          > >
          > > <noscript>
          > >
          > > <meta http-equiv="Refresh" content="3;url= index.html">
          > >
          > > </noscript>
          > >
          > > </head>
          > >
          > > </html>
          > >
          > >
          > >
          > > I want to choose which javascript to run based on the incoming link.
          > >
          > > I tried onload.target to choose, but I think I screwed up the sintax.
          > >
          > >
          > > --
          > > http://www.standards.com/; See Howard Kaikow's web site.
          > >
          > >[/color]
          >
          > How about the following instead?
          >
          > <html>
          > <head>
          > <script type="text/javascript">
          > location.href = "HKlinks.html?B ";
          > </script>
          > <noscript>
          > <meta http-equiv="Refresh" content="3;url= HowardKaikowSer vices.html">
          > </noscript>
          > </head>
          > </html>
          >
          >
          > <html>
          > <head>
          > <script type="text/javascript">
          > var loc = location.search ;
          > if (loc == "?A") location.href = "HowardKaikow.h tml";
          > if (loc == "?B") location.href = "HowardKaikowSe rvices.html";
          > </script>
          > <noscript>
          > <meta http-equiv="Refresh" content="3;url= index.html">
          > </noscript>
          > </head>
          > </html>
          >
          >[/color]


          Comment

          • Howard Kaikow

            #6
            Re: Choose code to run based on incoming URL

            How do I modify the code to handle both ? and # as bookmark delimiters?

            For example, in:
            <html>
            <head>
            <p><a href="HKlinks.h tml?B">B?</a></p>
            <p><a href="HKlinks.h tml?A">A?</a></p>
            <p><a href="HKlinks.h tml#B">B#</a></p>
            <p><a href="HKlinks.h tml#A">A#</a></p>
            </head>
            </html>

            Only the links using ? work.
            I commonly see # used instead f ? to separate the bookmark.


            What modifications are needed in the following HKlinks.html?
            <html>
            <head>
            <script type="text/javascript"><!--
            var loc=location.se arch;
            if(loc=="?A")lo cation.href="Ho wardKaikow.html ";
            if(loc=="?B")lo cation.href="Ho wardKaikowServi ces.html";
            //--></script>
            <noscript>
            <meta http-equiv="Refresh" content="3;url= index.html">
            </noscript>
            </head>
            </html>


            Comment

            • McKirahan

              #7
              Re: Choose code to run based on incoming URL

              "Howard Kaikow" <kaikow@standar ds.com> wrote in message
              news:ck3dm4$8sb $1@pyrite.mv.ne t...[color=blue]
              > How do I modify the code to handle both ? and # as bookmark delimiters?
              >
              > For example, in:
              > <html>
              > <head>
              > <p><a href="HKlinks.h tml?B">B?</a></p>
              > <p><a href="HKlinks.h tml?A">A?</a></p>
              > <p><a href="HKlinks.h tml#B">B#</a></p>
              > <p><a href="HKlinks.h tml#A">A#</a></p>
              > </head>
              > </html>
              >
              > Only the links using ? work.
              > I commonly see # used instead f ? to separate the bookmark.
              >
              >
              > What modifications are needed in the following HKlinks.html?
              > <html>
              > <head>
              > <script type="text/javascript"><!--
              > var loc=location.se arch;
              > if(loc=="?A")lo cation.href="Ho wardKaikow.html ";
              > if(loc=="?B")lo cation.href="Ho wardKaikowServi ces.html";
              > //--></script>
              > <noscript>
              > <meta http-equiv="Refresh" content="3;url= index.html">
              > </noscript>
              > </head>
              > </html>
              >[/color]

              First, you should no longer use "<!--" and "--> within <script> tags.

              Second, your <a> tags go inside the <body> not the <head> section.

              Thirdly, you have a solution with "?" why try to use "#"?

              "#" are used for bookmarks (as you know).

              "?" indicates a QueryString which can be interrogated by the called page.


              Comment

              • Howard Kaikow

                #8
                Re: Choose code to run based on incoming URL

                Because when I gove somebody a URL, I usually give it as a web page and,
                maybe, a bookmark on that web page, which is also how a lot of folkes are
                used to seeing a URL.

                I'll have no control whether they use a ? or a #.
                Here's what I have in the .js file, but the part about the # is doing what I
                need.

                <html>
                <head>
                <script type="text/javascript", SRC ="links.js"> </script>
                <noscript>
                <HR>
                <A href="index.htm l">The URL you used requires the use of JavaScript. If you
                wish to use the URL,
                please enable support for Javascript in your browser.
                You will shortly be taken to http://www.standards.com/index.html, or you can
                click here now.</A>
                <HR>
                <meta http-equiv="Refresh" content="0;url= index.html">
                </noscript>
                </head>
                </html>

                The following is currently the link.js file.

                var loc=location.se arch.toUpperCas e();
                if((loc=="?A")| |(loc=="#A")){
                location.href=" HowardKaikow.ht ml";
                }
                else if((loc=="?B")| |(loc=="#B")){
                location.href=" HowardKaikowSer vices.html";
                }
                else{
                alert(location. href + " is not a valid URL.\n" +
                "You will be taken to http://www.standards.c om/index.html.");
                location.href=" index.html";
                }


                --
                http://www.standards.com/; See Howard Kaikow's web site.
                "McKirahan" <News@McKirahan .com> wrote in message
                news:ZZa9d.1979 17$MQ5.6432@att bi_s52...[color=blue]
                > "Howard Kaikow" <kaikow@standar ds.com> wrote in message
                > news:ck3dm4$8sb $1@pyrite.mv.ne t...[color=green]
                > > How do I modify the code to handle both ? and # as bookmark delimiters?
                > >
                > > For example, in:
                > > <html>
                > > <head>
                > > <p><a href="HKlinks.h tml?B">B?</a></p>
                > > <p><a href="HKlinks.h tml?A">A?</a></p>
                > > <p><a href="HKlinks.h tml#B">B#</a></p>
                > > <p><a href="HKlinks.h tml#A">A#</a></p>
                > > </head>
                > > </html>
                > >
                > > Only the links using ? work.
                > > I commonly see # used instead f ? to separate the bookmark.
                > >
                > >
                > > What modifications are needed in the following HKlinks.html?
                > > <html>
                > > <head>
                > > <script type="text/javascript"><!--
                > > var loc=location.se arch;
                > > if(loc=="?A")lo cation.href="Ho wardKaikow.html ";
                > > if(loc=="?B")lo cation.href="Ho wardKaikowServi ces.html";
                > > //--></script>
                > > <noscript>
                > > <meta http-equiv="Refresh" content="3;url= index.html">
                > > </noscript>
                > > </head>
                > > </html>
                > >[/color]
                >
                > First, you should no longer use "<!--" and "--> within <script> tags.
                >
                > Second, your <a> tags go inside the <body> not the <head> section.
                >
                > Thirdly, you have a solution with "?" why try to use "#"?
                >
                > "#" are used for bookmarks (as you know).
                >
                > "?" indicates a QueryString which can be interrogated by the called page.
                >
                >[/color]


                Comment

                • Howard Kaikow

                  #9
                  Re: Choose code to run based on incoming URL

                  "Howard Kaikow" <kaikow@standar ds.com> wrote in message
                  news:ck3qi2$svn $1@pyrite.mv.ne t...[color=blue]
                  > Here's what I have in the .js file, but the part about the # is doing what[/color]
                  I[color=blue]
                  > need.[/color]

                  I meant to say "but the part about the # NOT is doing what I need".

                  [color=blue]
                  >
                  > <html>
                  > <head>
                  > <script type="text/javascript", SRC ="links.js"> </script>
                  > <noscript>
                  > <HR>
                  > <A href="index.htm l">The URL you used requires the use of JavaScript. If[/color]
                  you[color=blue]
                  > wish to use the URL,
                  > please enable support for Javascript in your browser.
                  > You will shortly be taken to http://www.standards.com/index.html, or you[/color]
                  can[color=blue]
                  > click here now.</A>
                  > <HR>
                  > <meta http-equiv="Refresh" content="0;url= index.html">
                  > </noscript>
                  > </head>
                  > </html>
                  >
                  > The following is currently the link.js file.
                  >
                  > var loc=location.se arch.toUpperCas e();
                  > if((loc=="?A")| |(loc=="#A")){
                  > location.href=" HowardKaikow.ht ml";
                  > }
                  > else if((loc=="?B")| |(loc=="#B")){
                  > location.href=" HowardKaikowSer vices.html";
                  > }
                  > else{
                  > alert(location. href + " is not a valid URL.\n" +
                  > "You will be taken to http://www.standards.c om/index.html.");
                  > location.href=" index.html";
                  > }
                  >
                  >
                  > --
                  > http://www.standards.com/; See Howard Kaikow's web site.
                  > "McKirahan" <News@McKirahan .com> wrote in message
                  > news:ZZa9d.1979 17$MQ5.6432@att bi_s52...[color=green]
                  > > "Howard Kaikow" <kaikow@standar ds.com> wrote in message
                  > > news:ck3dm4$8sb $1@pyrite.mv.ne t...[color=darkred]
                  > > > How do I modify the code to handle both ? and # as bookmark[/color][/color][/color]
                  delimiters?[color=blue][color=green][color=darkred]
                  > > >
                  > > > For example, in:
                  > > > <html>
                  > > > <head>
                  > > > <p><a href="HKlinks.h tml?B">B?</a></p>
                  > > > <p><a href="HKlinks.h tml?A">A?</a></p>
                  > > > <p><a href="HKlinks.h tml#B">B#</a></p>
                  > > > <p><a href="HKlinks.h tml#A">A#</a></p>
                  > > > </head>
                  > > > </html>
                  > > >
                  > > > Only the links using ? work.
                  > > > I commonly see # used instead f ? to separate the bookmark.
                  > > >
                  > > >
                  > > > What modifications are needed in the following HKlinks.html?
                  > > > <html>
                  > > > <head>
                  > > > <script type="text/javascript"><!--
                  > > > var loc=location.se arch;
                  > > > if(loc=="?A")lo cation.href="Ho wardKaikow.html ";
                  > > > if(loc=="?B")lo cation.href="Ho wardKaikowServi ces.html";
                  > > > //--></script>
                  > > > <noscript>
                  > > > <meta http-equiv="Refresh" content="3;url= index.html">
                  > > > </noscript>
                  > > > </head>
                  > > > </html>
                  > > >[/color]
                  > >
                  > > First, you should no longer use "<!--" and "--> within <script> tags.
                  > >
                  > > Second, your <a> tags go inside the <body> not the <head> section.
                  > >
                  > > Thirdly, you have a solution with "?" why try to use "#"?
                  > >
                  > > "#" are used for bookmarks (as you know).
                  > >
                  > > "?" indicates a QueryString which can be interrogated by the called[/color][/color]
                  page.[color=blue][color=green]
                  > >
                  > >[/color]
                  >
                  >[/color]


                  Comment

                  • McKirahan

                    #10
                    Re: Choose code to run based on incoming URL

                    "Howard Kaikow" <kaikow@standar ds.com> wrote in message
                    news:ck3qi2$svn $1@pyrite.mv.ne t...[color=blue]
                    > Because when I gove somebody a URL, I usually give it as a web page and,
                    > maybe, a bookmark on that web page, which is also how a lot of folkes are
                    > used to seeing a URL.
                    >
                    > I'll have no control whether they use a ? or a #.
                    > Here's what I have in the .js file, but the part about the # is doing what[/color]
                    I[color=blue]
                    > need.
                    >
                    > <html>
                    > <head>
                    > <script type="text/javascript", SRC ="links.js"> </script>
                    > <noscript>
                    > <HR>
                    > <A href="index.htm l">The URL you used requires the use of JavaScript. If[/color]
                    you[color=blue]
                    > wish to use the URL,
                    > please enable support for Javascript in your browser.
                    > You will shortly be taken to http://www.standards.com/index.html, or you[/color]
                    can[color=blue]
                    > click here now.</A>
                    > <HR>
                    > <meta http-equiv="Refresh" content="0;url= index.html">
                    > </noscript>
                    > </head>
                    > </html>
                    >
                    > The following is currently the link.js file.
                    >
                    > var loc=location.se arch.toUpperCas e();
                    > if((loc=="?A")| |(loc=="#A")){
                    > location.href=" HowardKaikow.ht ml";
                    > }
                    > else if((loc=="?B")| |(loc=="#B")){
                    > location.href=" HowardKaikowSer vices.html";
                    > }
                    > else{
                    > alert(location. href + " is not a valid URL.\n" +
                    > "You will be taken to http://www.standards.c om/index.html.");
                    > location.href=" index.html";
                    > }[/color]

                    First, you can change
                    if((loc=="?A")| |(loc=="#A")){
                    to
                    if(loc=="?A"||l oc=="#A"){
                    if you want.

                    Second, what do you mean that you "... have no control whether they use a ?
                    or a #" after you state "... when I gove [sic] somebody a URL". If you give
                    them a URL it has what ever suffix you include; such as "?A".

                    Thirdly, it still isn't clear what your really trying to accomplish (big
                    picture).

                    It isn't clear why you need to use "#"; is it that you want to jump "into" a
                    page and not just "to" a page?



                    Comment

                    • Howard Kaikow

                      #11
                      Re: Choose code to run based on incoming URL

                      I figured out how to handle both ? and #.

                      I also stumbled upon an easier way get help.
                      By putting the code in a .js file, I can right click and open in VS .NET
                      ..2003, which gives me the JScript help, etc.


                      Comment

                      • Howard Kaikow

                        #12
                        Re: Choose code to run based on incoming URL

                        "McKirahan" <News@McKirahan .com> wrote in message
                        news:fai9d.2185 09$3l3.31200@at tbi_s03...[color=blue]
                        > Second, what do you mean that you "... have no control whether they use a[/color]
                        ?[color=blue]
                        > or a #" after you state "... when I gove [sic] somebody a URL". If you[/color]
                        give[color=blue]
                        > them a URL it has what ever suffix you include; such as "?A".[/color]

                        Yes, but there's no reason to not also accept "#A".
                        I figured out how to do it, see below.
                        [color=blue]
                        > Thirdly, it still isn't clear what your really trying to accomplish (big
                        > picture).[/color]

                        I have a very narrow scope in mind.

                        I have a web site that has a number of pages I often reference in
                        newsgroup/web forum postings.
                        For example, a popular one is
                        http://www.standards.com/OhMyWord/WordVBABooks.htm, another recent one has
                        been
                        http://www.standards.com/OhMyWord/VB...teToolbar.html.

                        To make it easier for me to remember URLs to give to others and to
                        facilitate changing the structure of the web site, I decided that a "links"
                        page would be the right way to go. Server side links would be better, but I
                        do not yet know how to do that. Should not be difficult to make a custom 404
                        page, but I do not yet know how. I won't learn PHP just for this purpose.

                        I would always give URLs to the links page and the link would then be
                        redirected to the real page, so the above URLs would become, say:

                        http://www.standards.com/links.html#WordVBABooks and


                        Those URLs would be much easier to remember.

                        Of course, those URLs would only work if the user had Javascript enabled.
                        Otherwise, I will redirect to http://www.standards.com/.

                        The hard coded URL could still be used, but I won't guarantee those would
                        not change.
                        [color=blue]
                        > It isn't clear why you need to use "#"; is it that you want to jump "into"[/color]
                        a[color=blue]
                        > page and not just "to" a page?[/color]

                        All the URLs will be pointing to an anchor in the same page, each of which
                        will be redirected to the real URL.
                        If both ? and # work, then I see no reason why my script should not handle
                        both.

                        function CompareBookmark s(bmkTarget)
                        { var temp = bmkTarget.toLow erCase();
                        return (locSearch=="?" + temp)||(locHash =="#" + temp);
                        }
                        var locHash=locatio n.hash.toLowerC ase();
                        var locSearch=locat ion.search.toLo werCase();
                        if(CompareBookm arks("HowardKai kow")){
                        location.href=" HowardKaikow.ht ml";
                        }
                        else if(CompareBookm arks("HowardKai kowServices")){
                        location.href=" HowardKaikowSer vices.html";
                        }
                        else if(CompareBookm arks("SortPerfo rmanceCompariso n")){
                        location.href=" Sorting/SortPerformance Comparison-Description.htm l";
                        }
                        else if(CompareBookm arks("ThisandTh at")){
                        location.href=" index.html#This andThat";
                        }
                        else if(CompareBookm arks("CopyFileT oPrinter")){
                        location.href=" ThisAndThat/CopyFileToPrint er.html";
                        }
                        else{
                        alert(location. href + " is not a valid URL.\n" +
                        "You will be taken to http://www.standards.c om/index.html.");
                        location.href=" index.html";
                        }


                        Comment

                        • McKirahan

                          #13
                          Re: Choose code to run based on incoming URL

                          "Howard Kaikow" <kaikow@standar ds.com> wrote in message
                          news:ck4o9k$sdl $1@pyrite.mv.ne t...[color=blue]
                          > I figured out how to handle both ? and #.
                          >
                          > I also stumbled upon an easier way get help.
                          > By putting the code in a .js file, I can right click and open in VS .NET
                          > .2003, which gives me the JScript help, etc.[/color]


                          I'm glad that you figured it out...

                          The reason "#" is handled differently than "?" is because "?" denotes a
                          QueryString which is returned via location.search .


                          Comment

                          • Howard Kaikow

                            #14
                            Re: Choose code to run based on incoming URL

                            "McKirahan" <News@McKirahan .com> wrote in message
                            news:9Jm9d.1421 29$wV.114066@at tbi_s54...[color=blue]
                            > "Howard Kaikow" <kaikow@standar ds.com> wrote in message
                            > news:ck4o9k$sdl $1@pyrite.mv.ne t...[color=green]
                            > > I figured out how to handle both ? and #.
                            > >
                            > > I also stumbled upon an easier way get help.
                            > > By putting the code in a .js file, I can right click and open in VS .NET
                            > > .2003, which gives me the JScript help, etc.[/color]
                            >
                            >
                            > I'm glad that you figured it out...
                            >
                            > The reason "#" is handled differently than "?" is because "?" denotes a
                            > QueryString which is returned via location.search .[/color]

                            I saw that.

                            But I also now see that ? and # are mot interchangeable .
                            I found one page for which ? works, but # does not.







                            Comment

                            • Howard Kaikow

                              #15
                              Re: Choose code to run based on incoming URL

                              I solved the back button problem by using the replace method of the location
                              object.

                              --
                              http://www.standards.com/; See Howard Kaikow's web site.
                              "Howard Kaikow" <kaikow@standar ds.com> wrote in message
                              news:ck38sp$57t $1@pyrite.mv.ne t...[color=blue]
                              > Can I use a bookmark to selectively choose the code to be run?
                              >
                              >
                              >
                              > For example. Suppose we have the following in an HTML file:
                              >
                              >
                              >
                              > <html>
                              >
                              > <head>
                              >
                              > <script language="JavaS cript"><!--
                              >
                              > location.href = 'HKlinks.html#B '
                              >
                              > //--></script>
                              >
                              > <noscript>
                              >
                              > <meta http-equiv="Refresh" content="3;url= HowardKaikowSer vices.html">
                              >
                              > </noscript>
                              >
                              > </head>
                              >
                              > </html>
                              >
                              >
                              >
                              > And hklinks.html has:
                              >
                              >
                              >
                              > <html>
                              >
                              > <head>
                              >
                              > <a name="A"><scrip t language="JavaS cript"><!--
                              >
                              > location.href = 'HowardKaikow.h tml'
                              >
                              > //--></script></a>
                              >
                              > <a name="B"><scrip t language="JavaS cript"><!--
                              >
                              > location.href = HowardKaikowSer vices.html'
                              >
                              > //--></script></a>
                              >
                              > <noscript>
                              >
                              > <meta http-equiv="Refresh" content="3;url= index.html">
                              >
                              > </noscript>
                              >
                              > </head>
                              >
                              > </html>
                              >
                              >
                              >
                              > I want to choose which javascript to run based on the incoming link.
                              >
                              > I tried onload.target to choose, but I think I screwed up the sintax.
                              >
                              >
                              > --
                              > http://www.standards.com/; See Howard Kaikow's web site.
                              >
                              >[/color]


                              Comment

                              Working...