Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-17-2002, 05:48 PM   PM User | #1
Liz Beckman
New to the CF scene

 
Join Date: Jun 2002
Location: Colorado
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Liz Beckman is an unknown quantity at this point
Question Open-window for non-java browsers

My open Window javascript will not work gracefully for browsers with Javascript turned off; they click on the link and nothing happens. If Java is on, a new window opens that is sized as specified. To solve this, would I have to have something that detects whether the visitor has Javascript and loads a different page if they do? I wish my open Window script would open a new window of a specific size for Java browsers and would open in the same window for non-Java browsers. Here is the script I am using:

This part goes in the HEAD section:

<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->

This is the code around the LINK in the BODY section:

<a href="javascript:;" onClick="MM_openBrWindow('target-page.htm','Window TitleBar Name','toolbar=yes,scrollbars=yes,resizable=yes,width=600,height=400')">
LINK TEXT HERE
</a>

The problem is that users with Java turned off click on the link and go nowhere. Any solutions?
Liz Beckman is offline   Reply With Quote
Old 06-17-2002, 06:08 PM   PM User | #2
whackaxe
Senior Coder

 
Join Date: Jun 2002
Location: paris, france
Posts: 1,216
Thanks: 0
Thanked 0 Times in 0 Posts
whackaxe is an unknown quantity at this point
there is one handy dandy tag in html which goes something like this:

----------------------
<noscript>

this is what the user will see if theydo not have javascript activated

</noscript>
----------------------

as well in your link you should put somethin like

----------------------

<a href="something.html" target="_blank"> open window </a>

----------------------
whackaxe is offline   Reply With Quote
Old 06-17-2002, 07:37 PM   PM User | #3
Ökii
Regular Coder

 
Join Date: Jun 2002
Location: UK
Posts: 577
Thanks: 0
Thanked 0 Times in 0 Posts
Ökii is an unknown quantity at this point
<a href="target-page.htm" onClick="MM_openBrWindow('target-page.htm','Window TitleBar Name','toolbar=yes,scrollbars=yes,resizable=yes,wi
dth=600,height=400'); return false;" target="_blank">

Note the return false - though I'm not overly sure why, if a
browser can understand the onclick it will NOT do the href, if a
browser either hits an error or simply cannot do js it does the
href.
__________________
Ökii - formerly pootergeist
teckis - take your time and it'll save you time.
Ökii is offline   Reply With Quote
Old 06-17-2002, 07:41 PM   PM User | #4
Ökii
Regular Coder

 
Join Date: Jun 2002
Location: UK
Posts: 577
Thanks: 0
Thanked 0 Times in 0 Posts
Ökii is an unknown quantity at this point
Aha - I went back and read ALL of your post....

<a href="alternatepage.htm" target="_top" onclick="MM(); return false;">

target="parent" / "self" / "top" / "_new" / "_blank" / "setname"
are all posibilities I think. I never remember which ones have
underscores before them - tinker around til it works
__________________
Ökii - formerly pootergeist
teckis - take your time and it'll save you time.
Ökii is offline   Reply With Quote
Old 06-17-2002, 09:24 PM   PM User | #5
Liz Beckman
New to the CF scene

 
Join Date: Jun 2002
Location: Colorado
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Liz Beckman is an unknown quantity at this point
Smile

Perfect! Thanks so much for your replies! The return false worked like a charm... Thanks again!
Liz Beckman is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:10 PM.


Advertisement
Log in to turn off these ads.