JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

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 November 19th, 2001, 05:48 PM
yoshimitsu yoshimitsu is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Adelaide
Posts: 72 yoshimitsu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
difference between javascript:null(0) and #

Hi,
I know that when you use <a href="javascript:null(0)" onClick="open_win()">, it will not refresh the original page but just open the new window.

But when you use "<a href="#" onClick="open_win()">", does this refresh the original page and then open a new window??

Also does the first option work in some versions of IE (example 5.5 but not in 5.0) only??
Could you tell me which option would work in any version of IE??

Thanks for any replies.

Regards,

Yoshi
__________________
thats why i'm easy.....easy like sunday morning!

Reply With Quote
  #2  
Old November 19th, 2001, 06:20 PM
adios adios is offline
Senior Citizen
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2001
Location: leftcoast
Posts: 2,019 adios User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 15
Me again.

Here's the lowdown:

1)User clicks on link.
2)onclick handler executes.
3)Unless click event is then explicitly cancelled - by a) returning false, b) cancelling the bubbling of the event (IE/NS6), c) setting the event's returnValue - a property - to false - or d) some other new ways with the latest event model,
4)href is loaded.

If href="#", the hash mark indicates an anchor; since no anchor name is specified, it takes you to the top of the current page (with a reload). Not sure about the IE version question, but

<a href="#" onClick="open_win();return false;">

should work anywhere JavaScript/JScript is enabled.

adios

Reply With Quote
  #3  
Old November 19th, 2001, 06:24 PM
yoshimitsu yoshimitsu is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Adelaide
Posts: 72 yoshimitsu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
Thanks

Adios,
Thanks for your reply. Most of it made sense. I was under the impression that javascript:null(0) worked in any browser version too.

Anyway no worries, problem solved and learned something too.

Later,

Yoshi

Reply With Quote
  #4  
Old November 19th, 2001, 06:28 PM
adios adios is offline
Senior Citizen
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2001
Location: leftcoast
Posts: 2,019 adios User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 15
javascript:void(0) might; javascript:; (a MM fave) is sometimes used too...just return false; Yoshi, kills events like rat poison...

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > difference between javascript:null(0) and #

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap