View Full Version : omitting elements associated with javascript

08-25-2004, 04:34 AM
I have a link pointing to a feature that requires a javascript enabled browser. But I'd like for this link not to appear for browsers without javascript enabled.

So I use document.write('<a href=\"#\"></a>') to output the link to enabled browsers? Is this an appropriate use of document.write? Is there a better method?

08-25-2004, 04:45 AM
function feature(pID)
{ this.envokeElement = document.getElementById(pID).appendChild(document.createElement('span');
this.envokeElement.appendChild(document.createTextNode('Click to Run Script'));
this.envokeElement.onclick = function(e)
{ /* Do Stuff */

<body onload="new feature('parentID')">

08-25-2004, 07:02 AM
That seems a little... much? document.write()-ing out the link is an adequate solution.