Forum Moderators: open
In the javascript, all I have to really do is change a variable and call a function and the page is changed. This can also be done manually by setting a URL variable.
So my question is, is there a way to write a tag looking something like:
<a href="javascript:void(0)" onclick="cpage='4';reqMDFive('norefresh')">4</a>
if the user has javascript, but if they don't, then fall back on:
<a href="?pg=4">4</a>
?
I know about the <noscript> tag, but the trouble is, the first 4 will still be displayed, so the user will see 44.
If it were the other way around, I would make a script that loops and hides all the other tags, yet I want to hide the tags while javascript is OFF (or not supported).
Is there a <ifscript>the user only gets this if javascript is on</ifscript> tag? I have also tried writing the contents with document.write() but it simply does not work, seeing as the page has already been loaded and all.
I really need to get this problem fixed, please help!
<a href="?pg=4" onclick="cpage='4';reqMDFive('norefresh');return false;">4</a> The javascript in the onclick should block the link from working, but if there is no javascript, it should just go to the URL specified.
You could also start out with the elements you don't want to show hidden using
style="display:none;", then turn them back on with javascript when the page loads.