Redirect Script Compatibility

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

    #1

    Redirect Script Compatibility

    I don't know much about java scripts, but here is my attempt to write
    one. My script allows the user to enter their customer number into a
    textbox. When they click on a button, they are redirected to a PDF
    file. So if my customer number is 12345, I will be directed to
    http://www.websiteaddress.com/reports/12345.pdf whenever I type my
    customer number into the textbox.

    The script I wrote works with IE 6.0, but when I tested it with
    Netscape 4.7, it would not work. I'm not familiar with java scripts
    and browser compatibilities . Can someone take a look at my script and
    tell me what I need to change in this script to make it compatible
    with as many browsers as possible?

    Thanks!

    <HTML>
    <HEAD>
    <TITLE>View Report</TITLE>
    <SCRIPT LANGUAGE="JavaS cript">
    <!--
    function GetReport() {
    self.location.h ref = 'http://www.websiteaddr ess.com/reports/' +
    document.forms[0].txtValue.value + '.pdf';
    }
    // -->
    </SCRIPT>
    </HEAD>
    <BODY>
    <form ID="Form1">
    <input type=text name=text1 size=30 ID="txtValue">
    <input type=button value="View Report" onClick="GetRep ort()"
    ID="Button1" NAME="btnView">
    </form>
    </BODY>
    </HTML>
  • Lee

    #2
    Re: Redirect Script Compatibility

    crjunk said:[color=blue]
    >
    >I don't know much about java scripts, but here is my attempt to write
    >one. My script allows the user to enter their customer number into a
    >textbox. When they click on a button, they are redirected to a PDF
    >file. So if my customer number is 12345, I will be directed to
    >http://www.websiteaddress.com/reports/12345.pdf whenever I type my
    >customer number into the textbox.
    >
    >The script I wrote works with IE 6.0, but when I tested it with
    >Netscape 4.7, it would not work. I'm not familiar with java scripts
    >and browser compatibilities . Can someone take a look at my script and
    >tell me what I need to change in this script to make it compatible
    >with as many browsers as possible?[/color]

    The way that you're referencing the fields actually uses
    the NAME attribute, but you're specifying the ID value.
    IE lets you get away with many things that other browsers
    won't.

    They shouldn't really be called "java scripts".
    The JavaScript language has nothing to do with the Java language.

    Comment

    • crjunk

      #3
      Re: Redirect Script Compatibility

      Can someone provide an alternative piece of code that will accomplish this?

      Thanks for your help!

      crjunk

      Lee <REM0VElbspamtr ap@cox.net> wrote in message news:<braa2k02r u9@drn.newsguy. com>...[color=blue]
      > crjunk said:[color=green]
      > >
      > >I don't know much about java scripts, but here is my attempt to write
      > >one. My script allows the user to enter their customer number into a
      > >textbox. When they click on a button, they are redirected to a PDF
      > >file. So if my customer number is 12345, I will be directed to
      > >http://www.websiteaddress.com/reports/12345.pdf whenever I type my
      > >customer number into the textbox.
      > >
      > >The script I wrote works with IE 6.0, but when I tested it with
      > >Netscape 4.7, it would not work. I'm not familiar with java scripts
      > >and browser compatibilities . Can someone take a look at my script and
      > >tell me what I need to change in this script to make it compatible
      > >with as many browsers as possible?[/color]
      >
      > The way that you're referencing the fields actually uses
      > the NAME attribute, but you're specifying the ID value.
      > IE lets you get away with many things that other browsers
      > won't.
      >
      > They shouldn't really be called "java scripts".
      > The JavaScript language has nothing to do with the Java language.[/color]

      Comment

      • Thomas 'PointedEars' Lahn

        #4
        Re: Redirect Script Compatibility

        crjunk wrote:
        [color=blue]
        > Can someone provide an alternative piece of code that will accomplish this?
        >
        > [TOFU][/color]

        Can you <http://www.netmeister. org/news/learn2quote.htm l>?


        PointedEars

        Comment

        • crjunk

          #5
          Re: Redirect Script Compatibility

          Sorry.

          Thomas 'PointedEars' Lahn <PointedEars@we b.de> wrote in message news:<3FDD73F2. 4080709@Pointed Ears.de>...[color=blue]
          > crjunk wrote:
          >[color=green]
          > > Can someone provide an alternative piece of code that will accomplish this?
          > >
          > > [TOFU][/color]
          >
          > Can you <http://www.netmeister. org/news/learn2quote.htm l>?
          >
          >
          > PointedEars[/color]

          Comment

          Working...