Google
 
Webnews.only-4-geeks.com
Interesting places
news.only-4-geeks.com Forum Index » JavaScript

FAQ Topic - I have what

 
Jump to:  
 
FAQ server
PostPosted: Thu Sep 04, 2008 9:00 pm    Post subject: FAQ Topic - I have what
       
-----------------------------------------------------------------------
FAQ Topic - I have <a href="javascript:somefunction()"> what
.... ?
-----------------------------------------------------------------------

Whatever the rest of your question, this is generally a very bad
use of the javascript pseudo protocol. It was designed so that a
function could return a new document. For example:
` javascript:"<p>Hello</p>" `.
Using it simply to call a function when a link is clicked causes
an error in user agents that do not support javascript, or have
javascript disabled. Instead, use
` <a href="something.html" onclick="somefunction();return false"> `
where something.html is a meaningful alternative. Alternatively,
place the onclick event on another element so that users without
JavaScript aren't even aware that it does anything.

LINK


--
Postings such as this are automatically sent once a day. Their
goal is to answer repeated questions, and to offer the content to
the community for continuous evaluation/improvement. The complete
comp.lang.javascript FAQ is at LINK
The FAQ workers are a group of volunteers. The sendings of these
daily posts are proficiently hosted by LINK
 

Page 1 of 1 .:.

Google
 
Webnews.only-4-geeks.com

Windows Update | C++ | C | PHP | JavaScript | Photoshop | Programming | Windows 2000 | Python | Windows XP | Object | Flash | Flash - ActionScript | Paint Shop Pro | Excel | PowerPoint | Access | Word | Windows 98 | Internet Explorer 6.0 | CorelDraw12 | Java | XML | asm x86 | Linux Mandrake | Linux RedHat | Outlook |  | news from newsgroups |_ | s

Web Templates

Awesome Website Templates ©

orijen zakłady bukmacherskie rozwody smsy urodzinowe kredyty