/    Sign up×
Community /Pin to ProfileBookmark

javascript browser detection

Hey guys. Newbie to the forum. I’m sure my question is posted somewhere but I couldn’t really find anything.

This is really basic, but evidently I’m suffering from temporary Alzheimer’s.

I have and image map that uses a popup onCLick. It works fine in Firefox, but nothing else.

What is the [if] statement for browser detection. my small bit of script is below.

Thanks in advance.

function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == ‘string’)
href=mylink;
else
href=mylink.href;
window.open(href, windowname, ‘toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,directories=0,width=300,height=300,left = 490,top = 362’);
return false;
}

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@J2NYCAug 13.2009 — I've noticed the IE chokes if you fill in the window name. You might try leaving that as null and see if that works.
Copy linkTweet thisAlerts:
@beahumanauthorAug 13.2009 — Thanks for the quick reply, but that didn't fix it.
Copy linkTweet thisAlerts:
@J2NYCAug 13.2009 — Sorry. It's worked for me in the past.

The code for accessing the browser name is

var browser=navigator.appName;

in IE and AOL IE this will return "Microsoft."
×

Success!

Help @beahuman 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.19,
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,
)...