473,379 Members | 1,257 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,379 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 15957
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.