Cvermule

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Thursday, 23 March 2006

JavaScript Tip

Posted on 14:26 by Unknown
When dynamically creating an anchor in javascript, be sure to set not only the innerText (the text that appears between the open and closing tags), but also the innerHTML. Otherwise, if you try to view the said anchor in Firefox, it doesn't render.

Example:

var linkClose = document.createElement("A");

linkClose.href = "javascript:void(null)";
linkClose.innerText = "Close Window";
linkClose.innerHTML = "Close Window";
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Capturing the close event.
    When programming a thin-client application using HTML and JavaScript and you want to capture the closing event, it is not as easy as one thi...
  • Musicovery
    I found this site courtesy of http://www.i-am-bored.com . The name of the site is Musicovery . This is a site where you can listen to musi...

Categories

  • amazon
  • browser specific
  • coding
  • Eclipse
  • error
  • example
  • funny
  • google
  • grep
  • hacks
  • javascript
  • jott
  • music
  • null
  • phone
  • search
  • search engine
  • tip
  • tool
  • unix
  • web development
  • yui

Blog Archive

  • ►  2008 (5)
    • ►  September (1)
    • ►  August (1)
    • ►  July (1)
    • ►  June (1)
    • ►  January (1)
  • ►  2007 (6)
    • ►  December (1)
    • ►  September (1)
    • ►  July (1)
    • ►  June (1)
    • ►  March (2)
  • ▼  2006 (10)
    • ►  November (1)
    • ►  August (1)
    • ►  May (2)
    • ►  April (4)
    • ▼  March (2)
      • JavaScript Tip
      • Why Computers Sometimes Crash! by Dr. Seuss.
  • ►  2005 (10)
    • ►  August (3)
    • ►  June (2)
    • ►  February (5)
  • ►  2004 (9)
    • ►  October (2)
    • ►  September (7)
Powered by Blogger.

About Me

Unknown
View my complete profile