473,388 Members | 884 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,388 software developers and data experts.

help on window.location

hi,

i do have dropdown box that contains several items with attached
links:

<select class="text" onchange="linker()" name="menu1">
<option value="#" selected="selected">--- Countries
---</option>
<option
value="#">Argentina</option>
<option value="#">Australia</option>
<option value="#">Brazil</option>
<option value="#">Canada</option>
<option value="#">China</option>
<option value="http://
www.mypage.com"class="textRed">*France</option>

the linker() function:

function linker(){
var s=menu1.options[menu1.selectedIndex].value;
if(s !== '#'){
window.location.href = s;
}

this works perfectly IE but in doesnt work in firefox. can someone pls
tell me what is wrong?

tnx

May 5 '07 #1
7 15958
shotokan99 said the following on 5/4/2007 11:31 PM:
hi,

i do have dropdown box that contains several items with attached
links:

<select class="text" onchange="linker()" name="menu1">
onchange="linker(this.value)"

<snip>
function linker(){
function linker(theValue){
if(theValue !== "#"){

}
}
var s=menu1.options[menu1.selectedIndex].value;
if(s !== '#'){
window.location.href = s;
}

this works perfectly IE but in doesnt work in firefox. can someone pls
tell me what is wrong?
You are relying on the IE behavior of making names and ID atttributes
global variables (menu1) whereas Firefox doesn't.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 5 '07 #2
ah ok. so what is the best way to do it?

May 7 '07 #3
shotokan99 said the following on 5/6/2007 10:04 PM:
ah ok. so what is the best way to do it?
Best way to do what?

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 7 '07 #4
Randy Webb wrote:
shotokan99 said the following on 5/6/2007 10:04 PM:
>ah ok. so what is the best way to do it?

Best way to do what?
I think (s)he was talking about the best way to lure a blond
nymphomaniac to a deserted island.

Not totally sure as the topic is throwing me, and I cannot remember the
content without adequately quoted/trimmed um... content.

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
May 7 '07 #5
if this function is specific for ie:
function linker(){
var s=menu1.options[menu1.selectedIndex].value;
if(s !== '#'){
window.location.href = s;
}

how to do it with firefox?

May 7 '07 #6
-Lost said the following on 5/7/2007 1:15 AM:
Randy Webb wrote:
>shotokan99 said the following on 5/6/2007 10:04 PM:
>>ah ok. so what is the best way to do it?

Best way to do what?

I think (s)he was talking about the best way to lure a blond
nymphomaniac to a deserted island.
Simple. Tell her no blonds allowed. She will show up to find out why not :-)
Not totally sure as the topic is throwing me, and I cannot remember the
content without adequately quoted/trimmed um... content.
I would tell you the topic but I would have to quote it to show you first :)

Here is one though:

Answer: Google Groups

I would tell you the question but I didn't quote it <g>

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 7 '07 #7
shotokan99 said the following on 5/7/2007 5:27 AM:
if this function is specific for ie:
It isn't specific for IE. It is specific for any browser that makes a
name/id a global variable. Read the FAQ on a way to correct it (It has
an entry of its own, even though the entry pushes the crutch of gEBI).
function linker(){
var s=menu1.options[menu1.selectedIndex].value;
if(s !== '#'){
window.location.href = s;
}
how to do it with firefox?
Re-write it. Either using the tidbits I gave you, consult the group FAQ
(4.41) or try not quoting again.

But, how many times do you think people are going to look up old posts
in order to find out what you are asking about because you didn't quote
what you were replying to? I know it is "in your face" with Google
Groups but not everybody uses GG, some use a real newsreader.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 7 '07 #8

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

Similar topics

3
by: Steven | last post by:
All I want to pop up a window before/during redirect to another page. Sort of a confirmation page: <? .... /* I need to pop up a window here */
1
by: martingerber | last post by:
Hi, I have the following script (javascript in html document): <html> <head> <meta http-equiv="content-type" content="text/html;charset=ISO-8859-1"> <title>Standort Speichern</title>
2
by: Jackson Yap | last post by:
can someone kind enough to help me look at the attached html and js file? Why is it that the javascript menu could not work at www.apchosting.net but could work at...
19
by: Darren | last post by:
I have a page that opens a popup window and within the window, some databse info is submitted and the window closes. It then refreshes the original window using window.opener.location.reload(). ...
33
by: Todd | last post by:
OK, I created a .htm page within a new Web solution: -------------------------------------------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head>...
9
by: Robert Porter | last post by:
I have been experimenting with the Screen object. It has a property called Screen.DeviceName which returns a string value similar to the following: \\.\DISPLAY1 or \\.\DISPLAY2 I have 2...
1
by: Michael D. Reed | last post by:
I am using the help class to display a simple help file. I generated the help file using Word and saving it as a single page Web page (.mht extension). I show the help file with the following...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
5
by: althafexcel | last post by:
hi everyone Im trying to include an external js in my aspx page under the head tag, it doesn't load or it displays an object expected error whenver the function from the .js is called. Actually...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.