what ... ? (2008-05-09) - JavaScript [RSS]" href="http://www.talkaboutprogramming.com/group/comp.lang.javascript/index.rss" />
Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > JavaScript > FAQ Topic - I h...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 35535 of 36382
Post > Topic >>

FAQ Topic - I have <a href="javascript:somefunction()"> what ... ? (2008-05-09)

by "FAQ server" <javascript@[EMAIL PROTECTED] > May 8, 2008 at 11:00 PM

-----------------------------------------------------------------------
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 do***ent. 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 sup****t 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.

http://www.useit.com/alertbox/20021223.html


-- 
 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 http://jibbering.com/faq/index.html.
 The FAQ workers are a group of volunteers.  The sendings of these 
 daily posts are proficiently hosted by http://www.pair.com.
 




 1 Posts in Topic:
FAQ Topic - I have what ...
"FAQ server" &l  2008-05-08 23:00:01 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 5:16:57 CDT 2008.