473,657 Members | 2,407 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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>
Jul 20 '05 #1
4 1337
Lee
crjunk said:

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?


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.

Jul 20 '05 #2
Can someone provide an alternative piece of code that will accomplish this?

Thanks for your help!

crjunk

Lee <RE************ **@cox.net> wrote in message news:<br******* **@drn.newsguy. com>...
crjunk said:

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?


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.

Jul 20 '05 #3
crjunk wrote:
Can someone provide an alternative piece of code that will accomplish this?

[TOFU]


Can you <http://www.netmeister. org/news/learn2quote.htm l>?
PointedEars
Jul 20 '05 #4
Sorry.

Thomas 'PointedEars' Lahn <Po*********@we b.de> wrote in message news:<3F******* *******@Pointed Ears.de>...
crjunk wrote:
Can someone provide an alternative piece of code that will accomplish this?

[TOFU]


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

Jul 20 '05 #5

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

Similar topics

10
9347
by: Bob Garbados | last post by:
forgive my ignorance, as I'm new to php coming from a ms background... If I create a page named redirect.php and it's only content is: <?php header("Location: http://www.google.com"); ?> Should it not redirect to www.google.com? I can't get the header() function to redirect. I'm trying to take an online reservation... the customer fills out
2
2306
by: Sentinel | last post by:
here is the entire thread From: "Kimmo Laine" <eternal.erectionN0.5P@Mgmail.com> Subject: Re: script in body Date: Mon, 20 Jun 2005 17:46:28 +0300 Message-ID: <d96klv$8vi$1@phys-news1.kolumbus.fi> Lines: 64 "Sentinel" <support@elma.hr> kirjoitti
6
4445
by: Tim Stokes | last post by:
Hi all, I want to do a similar action to response.redirect ("file.htm"). But the file.htm contains some sensitive data. I have placed file.htm in a folder in the InetPub (d:\inetpub\privateroot\file.htm) so that it is not accessible by a simple HTTP request. An asp login script will be used, and then once the user is verified the page should redirect to d:\inetpub\privateroot\file.htm. But obviously I cannot use response.redirect...
7
15913
by: Donna Hawkins | last post by:
I want to use javascript to redirect to a URL which has been passed as a variable (in php). I have searched but cannot find any solution. I think this code is a basic redirect: <script type="text/javascript"> window.location = "http://www.someserver.com/somePage.html"; </script>
30
3889
by: Toni Mcintyre | last post by:
i'm having 2 problems with the http://validator.w3.org 1. if i have: <meta http-equiv="Content-Script-Type" content="text/javascript"> then why do i need <script type=text/javascript> everywhere??? i'm writing most of my code by hand, so this is a lot of extra typing or global search and replace later 2. the other problem is with my include files: i usually <script src="foo.js"></script>
7
1188
by: ndessai | last post by:
Hi All, I discovered following issue with the VC 7.1 compiler regarding the backword compatibility. I created a dll (Redirect.dll) which exposes a function and simply writes some text (say "Hello World") to stderr stream. I also created a driver program (driver.exe) and used the exposed function from the above dll. The driver.exe tries to redirect the stderr stream to a file "stderr.txt" before calling the method from the dll. (used...
4
970
by: Dave | last post by:
Is there a way to do a Response.Redirect and do a popup on the redirect?
7
13441
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I am trying to set this up using asp code and IIS configuration. But it seems not working. Here it is the way I am doing. In IIS I set up a virtual directory with secure communication, I checked require secure channel, require 128-bit encryption. In custom error, instead of using default message HTTP 403.4 - Forbidden: SSL required Internet Information Services in iishelp 403.4htm, I am trying to do redirect automatically. so I...
1
7280
by: gnawz | last post by:
Hi guys, I have a couple of php files that perform various tasks. I will use fields in my system and provide code as well I need help as follows: My database contains the fields Category and Brand I need to make some changes on a a number of brands in a Category
0
8411
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8838
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8613
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7351
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2740
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1732
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.