PDA

View Full Version : Browser Specific Pop-Up


StonedDevil
06-23-2006, 12:49 AM
well i dont know anything about javascript, but did some googleing and came up with this.... which doesnt work.... I just need it to pop up if there using anything other than firefox, or netscape. Any help would rock. As i said i dont know javascript at all really, so thanks in advance :D


var detect = navigator.userAgent.toLowerCase();
var browser,version,total,thestring;
if (!checkIt('netscape'))
{
browser = "Netscape Navigator"
}
else browser = "Other"

if (browser != "Netscape Navigator")
{
// <![CDATA[
window.open('http://www.stoneddevilinc.com/pop_up.html', '', 'width=550,height=460,scrollbars=yes');
// ]]>
}

function checkIt(string)
{
place = detect.indexOf(string) + 1;
thestring = string;
return place;
}

Kravvitz
06-23-2006, 01:48 AM
What's wrong with Opera, Safari, Konqueror, and iCab?

StonedDevil
06-23-2006, 02:17 AM
What's wrong with Opera, Safari, Konqueror, and iCab?

well i dont have any of them and havent tested them, nor did i really care about testing IE, so i have a pop-up to let people know this, jsut on first load. Nothing wrong with them, its my code :D also i want as many people using IE to get firefox, cause im one of those firefox supporters, so it works out both for getting more FF users, and also to let people know :D

_Aerospace_Eng_
06-23-2006, 02:31 AM
So because you can't seem to code for other browsers you want to single them out? Learn to code cross browser and you won't have an issue.

StonedDevil
06-23-2006, 02:34 AM
So because you can't seem to code for other browsers you want to single them out? Learn to code cross browser and you won't have an issue.

i code in basic css and html, all validated. im saying i havent checked them in other browsers. Im not attacking other ones, and was not looking to get attacked for that, just wondering what i was doing wrong in my scripting. sheesh

_Aerospace_Eng_
06-23-2006, 02:41 AM
i code in basic css and html, all validated. im saying i havent checked them in other browsers. Im not attacking other ones, and was not looking to get attacked for that, just wondering what i was doing wrong in my scripting. sheesh
Then check in as many browsers as you can. As a web designer its your job to do so. There is no need to single out certain users because of their browsers. I'll tell you one thing, if a site did this to me, you can be certain I wouldn't be going back to the same site ever again.
var detect = navigator.userAgent.toLowerCase();
var browser,version,total,thestring;
if (!checkIt('netscape') || !checkIt('mozilla'))
{
window.open('http://www.stoneddevilinc.com/pop_up.html','','width=550,height=460,scrollbars=yes');
}

function checkIt(string)
{
place = detect.indexOf(string) + 1;
thestring = string;
return place;
}
Chances are the popup is going to get blocked anyways.

StonedDevil
06-23-2006, 02:47 AM
Then check in as many browsers as you can. As a web designer its your job to do so. There is no need to single out certain users because of their browsers. I'll tell you one thing, if a site did this to me, you can be certain I wouldn't be going back to the same site ever again.

Chances are the popup is going to get blocked anyways.

i swear almost every other post i see from you, granted i dont look alot, is you attacking something of how someone works there coding or site. I work on a computer that is not mine, so installing other broswers is not an option, im not allowed to install more. Add in that some require me to have a mac or linux. Add in that i dont have time or money with work, and add a pinch of web design and template design is a hobby not my profesion, at least for now, then i have no plans on doing the testing.

Granted if people who have access to the other broswers helps me with testing, then yes ill gladly remove the popup. BUT until that happens, this saves me the trouble of having to respond to the tons of comments and forum posts i used to get that my site didnt work in another broswer, people who would visit once and leave, not offering to help me test it, just letting me know. with this it lets them know i already know.

You assumed i was doing it from dislike of other browsers, or inabilities in coding, and so for, and assumption is the mother of all screw ups.

_Aerospace_Eng_
06-23-2006, 03:20 AM
Not really attacking, just telling them that there are better ways of doing things. Fine its not your profession, you probably don't care but I do as I get paid for coding and designing sites. You may be interested in this http://www.explorerdestroyer.com/
How can I assume when you say things like this?
Nothing wrong with them, its my code also i want as many people using IE to get firefox, cause im one of those firefox supporters, so it works out both for getting more FF users, and also to let people know
From that part alone I gathered that you couldn't code for other browsers. You are telling me you don't have IE on your system? Chances are if it looks good in Firefox it will look good in the other modern browsers as well. It may take only a few lines of CSS to get IE looking like Firefox. I think you will find this interesting. http://www.explorerdestroyer.com/ BTW you are welcome for the script I corrected for you.

StonedDevil
06-23-2006, 03:59 AM
Not really attacking, just telling them that there are better ways of doing things. Fine its not your profession, you probably don't care but I do as I get paid for coding and designing sites. You may be interested in this http://www.explorerdestroyer.com/
How can I assume when you say things like this?

From that part alone I gathered that you couldn't code for other browsers. You are telling me you don't have IE on your system? Chances are if it looks good in Firefox it will look good in the other modern browsers as well. It may take only a few lines of CSS to get IE looking like Firefox. I think you will find this interesting. http://www.explorerdestroyer.com/ BTW you are welcome for the script I corrected for you.

well its all good, i was assuming too. get your points. But i dont get paid for coding, thats what i meant by you doing assumptions. I do it as a hobby, for fun. All my designs i give out for free. Yes thanks for the code and link. Looks like ill use this