HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 12th, 2000, 08:24 AM
zcrar70's Avatar
zcrar70 zcrar70 is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 49 zcrar70 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
this code was posted a couple days ago by spookster:

<script language="JavaScript">
<!--//
function Browser()
{
if (navigator.appVersion.indexOf("(X11") != -1 | | navigator.appVersion.indexOf("(Mac") != -1) return 1
else return 0
}

function Description(url,dow,winwidth,winheight)
{
if (stat == 0)
{
description = window.open(url,'descr',"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,scrollbars=auto,resizable=no ,copyhistory=no,width='+winwidth+',height='+winheight'" )
description.focus()
stat=dow
if (Browser() == 1 ) {window.open(url,'descr')}
}

else
{
description.close()
if (stat != dow)
{
stat=dow
description=window.open(url,'descr',"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,scrollbars=auto,resizable=no ,copyhistory=no,width='+winwidth+',height=' +winheight'")
description.focus()

if (Browser() == 1 ) {window.open(url,'descr')}
}

else
{
stat=0
}
}
}
//-->
</script>
<script language="JavaScript">
<!--//
stat=0
dow=0
//-->
</script>

The link is called by:

<a href="javascript:description('http://www.domain.com/products.php','10','300','275')">


It's supposed to check for a browser version with JS enabled, and if not the link should open as a normallink, as opposed to a JS popup window.

the script doesn't work though, and i'm a javascript novice.... can anyone help ????

cheers,
nick


ps thx spookster for the original post !

Reply With Quote
  #2  
Old July 18th, 2000, 02:48 PM
lhallusa lhallusa is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 43 lhallusa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Send a message via ICQ to lhallusa
I can't help much but I found a couple errors.

The | | should not have a space between them.
Should be | |.
Also your call to description(). The D is uppercase
<a href="javascript escription('http://www.domain.com/products.php','10','300','275')">

Also if the browser doesn't support javascript then none of the code will execute. So use this scheme:
<script language="javascript">
... bla bla bla
</script>
<noscript>
HTML ....
</noscript>
The noscript can't be javascript and will only render if the browser has javascript disabled or doesn't support it.
By the way.
Beware of copying code from this bulletine board as it modifies spaces between things.
Like the | | I can't get it to not have the space there.

------------------
webpatron.com

[This message has been edited by lhallusa (edited July 18, 2000).]

[This message has been edited by lhallusa (edited July 18, 2000).]

[This message has been edited by lhallusa (edited July 18, 2000).]

[This message has been edited by lhallusa (edited July 18, 2000).]

[This message has been edited by lhallusa (edited July 18, 2000).]

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > open new window depending on if JS enabled or not


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway