/    Sign up×
Community /Pin to ProfileBookmark

How Do I Exclude selected scripts on a page

Hi All,

Nice Site, I’m nubie to to Javascript, there I’ve admitted it.
I am trying to exclude all browsers except IE 6 or better on a page.
I have 3 pop up menus, I do not want other browsers to activate the javascript mouseovers do to positioining issues.
The popups are hidden layers that show when moused over. I have some code that will determine the browser and version and such. How would I kill the script?
here is what I was trying to make work , but can’t seem to get the return function to work.
function killscript()
{
return
}
if (is_ie6==”true”) {return()};

I have included the pop up scripts and the detect scripts

Here is the browser detect script
<!–
// convert all characters to lowercase to simplify testing
var agt=navigator.userAgent.toLowerCase();

// *** BROWSER VERSION ***
// Note: On IE5, these return 4, so use is_ie5up to detect IE5.
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);

var is_ie = ((agt.indexOf(“msie”) != -1) && (agt.indexOf(“opera”) == -1));
var is_ie3 = (is_ie && (is_major < 4));
var is_ie4 = (is_ie && (is_major == 4) && (agt.indexOf(“msie 4”)!=-1) );
var is_ie4up = (is_ie && (is_major >= 4));
var is_ie5 = (is_ie && (is_major == 4) && (agt.indexOf(“msie 5.0”)!=-1) );
var is_ie5_5 = (is_ie && (is_major == 4) && (agt.indexOf(“msie 5.5”) !=-1));
var is_ie5up = (is_ie && !is_ie3 && !is_ie4);
var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);
var is_ie6 = (is_ie && (is_major == 4) && (agt.indexOf(“msie 6.”)!=-1) );
var is_ie6up = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);

here is the script for the window pop ups. Any suggestion, thanks in advance…
function MM_reloadPage(init) { //reloads the window if Nav4 resized

if (init==true) with (navigator) {if ((appName==”Netscape”)&&(parseInt(appVersion)==4)) {

document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}

else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();

}

MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01

var p,i,x; if(!d) d=document; if((p=n.indexOf(“?”))>0&&parent.frames.length) {

d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

if(!x && d.getElementById) x=d.getElementById(n); return x;

}

function MM_showHideLayers() { //v6.0

var i,p,v,obj,args=MM_showHideLayers.arguments;

for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];

if (obj.style) { obj=obj.style; v=(v==’show’)?’visible’:(v==’hide’)?’hidden’:v; }

obj.visibility=v; }

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@FangNov 18.2005 — Use [URL=http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp]conditional comments[/URL]. Place the code for IE6+ in the CC which must be placed after other JavaScripts.&lt;!--[if IE 6]&gt;
&lt;script type="text/javascript"&gt;
alert("Congratulations. You are running IE6 or later!");
&lt;/script&gt;
&lt;![endif]--&gt;
×

Success!

Help @prs2 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...