User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 391,808 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,483 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1445 | Replies: 4
Reply
Join Date: Jun 2006
Location: UK (Bristol)
Posts: 225
Reputation: Mushy-pea is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 1
Mushy-pea's Avatar
Mushy-pea Mushy-pea is offline Offline
Posting Whiz in Training

Null hyperlink: OK?

  #1  
Aug 5th, 2006
Hello fellow web designers. I used Dreamweaver to place a rollover image on one of my web pages. It uses Javascript. When I looked at the code it had written, it includes the following null hyperlink on the image:

[HTML]<a href="#"><img src="rochfest-logo.gif" onmouseover="stuff" onmouseout="more stuff"></a>[/HTML]

Is there any chance this null link could cause errors on some browsers? I have only tested the page on IE6. Thanks for any help.

Steven.
Last edited by tgreer : Aug 5th, 2006 at 11:53 am.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2004
Posts: 1,589
Reputation: tgreer is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 34
Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: Null hyperlink: OK?

  #2  
Aug 5th, 2006
That isn't "null", it's a hyperlink to an anchor. In the abscene of any specific anchor, it will refer to the top of the document.

Please post your code within either the HTML,CODE or INLINECODE forum tags.
Reply With Quote  
Join Date: Jun 2004
Location: Hemet, CA
Posts: 427
Reputation: FC Jamison is on a distinguished road 
Rep Power: 5
Solved Threads: 17
Colleague
FC Jamison's Avatar
FC Jamison FC Jamison is offline Offline
Posting Pro in Training

Re: Null hyperlink: OK?

  #3  
Aug 5th, 2006
Absolutely true.

Also, the anchor link will have no detrimental effect to your Web page in any browser. You could probably save some overhead though by using CSS instead of JavaScript.
Reply With Quote  
Join Date: Jun 2006
Location: UK (Bristol)
Posts: 225
Reputation: Mushy-pea is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 1
Mushy-pea's Avatar
Mushy-pea Mushy-pea is offline Offline
Posting Whiz in Training

Re: Null hyperlink: OK?

  #4  
Aug 7th, 2006
Thanks for the advice.

Originally Posted by Deacon J
You could probably save some overhead though by using CSS instead of JavaScript.

Can I take this to mean that CSS allows the placement of swapable and roll over images? Wouldn't that require the use of Javascript event detectors (i.e. onmouseover) anyway?

Steven.
Reply With Quote  
Join Date: Jun 2004
Location: Hemet, CA
Posts: 427
Reputation: FC Jamison is on a distinguished road 
Rep Power: 5
Solved Threads: 17
Colleague
FC Jamison's Avatar
FC Jamison FC Jamison is offline Offline
Posting Pro in Training

Re: Null hyperlink: OK?

  #5  
Aug 7th, 2006
No, you can use the pseudoclass :hover to change the background image. i.e.

a {background-image: url(image1.jpg); }
a:hover {background-image: url(image2.jpg); }
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 5:33 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC