Posted by Jim Higson on 06/18/06 10:11
CRON wrote:
>
> Best solution found::::
>
> <a href="#" onclick="func();return false">
>
> This is a handy way to stop the page from jumping around but still run
> the function.
The best way I'd say is to not include any link in the page, but then add it
in using javascript once the page has loaded.
Or, if the link must be created on the server-side, try something like:
<a href="javascript:whatever()" style="display:none" id="js-link">blah</a>
<script type="text/javascript">
var link_ele = document.getElementById( "js-link" );
link_ele.setAttribute( "sytle", "" );
</script>
This way, the link will only be shown if the user has javascript enabled.
--
Jim
[Back to original message]
|