![]() |
How to make URL link that uses Javascript work if Javascript is disabled?
Does anyone know how to make URL links that use Javascript still work when
users have Javascript disabled on their browser? The only reason I'm using JS on a URL is because my link opens a PDF file, and I'm forcing it not to cache so users have the latest version. I tried the <script><noscript> tags, but I'm not sure if I'm using it correctly, as my URL completely disappears. Below is my HTML/Javascript code: <p class="download"> <script type="text/javascript">document.write("<span style=\"text-decoration: underline;\"><a href=\"javascript:void(0);\" onclick=\"window.open( 'http://www.webchild.com.au/mediakit/Direct_Media_Kit_Web.pdf?nocache='+ Math.floor( Math.random()*11 ) );\" >The Child Magazines Media Kit</a></span> (PDF 1 MB) ");</script> <noscript><span style="text-decoration: underline;"><a href="http://www.webchild.com.au/mediakit/Direct_Media_Kit_Web.pdf" >The Child Magazines Media Kit</a></span> (PDF 1 MB)</noscript> </p> Thanks for any help, Michael |
You use <script><noscript> the right way.
But there is no reason for style the spans with text-decoration. The only content it has is a link that by default is underline. In fact you do not need the spans at all here. Code:
<p class="download"> |
Quote:
The following is all that you need to do it: Code:
<a |
No need to specify the URL twice and escape the single quotes.
Code:
<a href="http://www.webchild.com.au/mediakit/Direct_Media_Kit_Web.pdf" |
| All times are GMT +1. The time now is 05:18 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.