English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I wrote the following script;

function msOver(subName){
eval(subName). style. backgroundImage = url(imgs/download_bg.gif)';
}

function msOut(subName){
eval (subName) . style . backgroundImage = 'none';
}

All the browsers support this script besides Firefox and Navigator?

Note: the spaces that I've added between the "." dots in the script is only for Yahoo Answers, otherwhise it shows "backgroundIm..." in place of "backgroundImage"

2007-04-25 23:20:58 · 4 answers · asked by iguana 4 in Computers & Internet Programming & Design

4 answers

eval is evil!

your code will only work in versions of Microsoft Internet Explorer.

drop the eval and pass in a reference to the tag!


function msOver(subName){
subName . style. backgroundImage = url(imgs/download_bg.gif)';
}

then call it like

2007-04-26 06:09:16 · answer #1 · answered by jake cigar™ is retired 7 · 1 0

The original netscape and microsoft browser standards differ, there are lists at the sites for each of these to determine which calls are supported, the ultimate answer id to test the browser type of the client and then run alternative sections of script for each.

2007-04-25 23:27:49 · answer #2 · answered by Anonymous · 0 1

each from time to time you won't be able to acquire issues from Mozilla by using the indisputable fact that distinct internet web site would not suppor the browser, yet for the most section, Mozilla is extra efficient than Netscape (in my opinion).

2016-12-04 21:40:07 · answer #3 · answered by ? 4 · 0 0

I know I'm not giving you a direct answer, but...see either and/or both the two cited references (you'll want to keep them around for frequent reference) for cross-browser differences...

2007-04-26 05:52:21 · answer #4 · answered by fjpoblam 7 · 0 1

fedest.com, questions and answers