Hi there,
Would anyone be kind enough to tell me how you make javascript links please? Like Chris links to other pages, but the link actually reads on this site (if ya get me)!
Mike
Printable View
Hi there,
Would anyone be kind enough to tell me how you make javascript links please? Like Chris links to other pages, but the link actually reads on this site (if ya get me)!
Mike
a javascript link can be made any number of ways
<a href = "javascript:void" onclick = "window.open(url);">
would be one.
Thanks,
Will this mean my PR will not go down if I am linking to other sites please?
If you link like that, no it will not go down.
Thanks Chris...
I have the following:
Would that be OK please?Code:<a href = "javascript:void" onclick = "window.open('links.html');" class="cssclass" title="title of link">LINKS</a>
Sorry for all the bother...
yes
Thanks for all the help:)
Hi all,
It's a new issue but since there are may common points i thought it is a good idea to post here.
Will search engines follow such a link?
What is your opinions?Code:<script type="text/javascript">
function loadUrl(newLocation)
{
window.location.href = newLocation;
}
</script>
<a href="http://somesite.com" onclick="loadUrl(this.href); return false;">link-1</a>
Thanks in advance for any ideas
yes.
what about this one?
<a href="java script:void" class="menu" onclick="window.location.href='http://www.domain.com'; return false;">domain.com</a>
that should work.
A better way is to do
<script language = "javascript">
document.write('<a hre' + 'f = "ht' + 'tp://ww' + 'w.dom' + 'ain.com">text</a>');
</script>
If you really want to use javascript. There is nothing there that a search engine can parse a url from.
it worked! many thanks
(for other readers there is a typo in Chris' last post)
not <script language = "javascript>
<script language = "javascript">
just wanted to note it
how do u create a javascript link ? without opening another window ?
i tried this
<a href = "javascript:void" onclick = "window.open(url);">
but it seems to come up a error for me
that'd still open another window,
using top.href or self.href should work without opening another window.
Bringing an old topic back...
I hope to have a javascript menu as top navigation, with the rest being text links. It won't really matter as all the important pages will be linked to with text links. So my question is would the following be ok? Or would it pass PR on?
Thanks,Code:<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image10','','images/b1r.jpg',1)">
<img src="images/b1.jpg" name="Image10" width="95" height="19" border="0"></a>
<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image4','','images/b2r.jpg',1)">
<img src="images/b2.jpg" name="Image4" width="70" height="19" border="0"></a>
Mike
I edited your post so we didn't have horizontal scroll.
That should not pass PR. However it doesn't look like it'd function as a link either.
Thanks for editting it:)
I've not tried it for functioning yet, I bought a Templatemonster template so that could be the reason:)
Anyway thanks Chris.
Oh yeah and just on the topic of javascript links...
if you are using '(<a hre + 'f="http://") could you change it into <a hre + f="http://"). Like I don't need/want the document.write bit there, so would the way I show be the right way of going about things?
I just use the following...
<a href="#" onclick="window.open('http://www.url.com')">Text</a>
Ofcoarse, thats if you want to open the link in a new window.
________
roor bong
Huh? Your saying you dont want the document.write bit? I dont quite understand that - thats how JS writes to the page.Quote:
Originally posted by Mike
if you are using '(<a hre + 'f="http://") could you change it into <a hre + f="http://"). Like I don't need/want the document.write bit there, so would the way I show be the right way of going about things?
You use JS to write the code so that you can break up the "<a href=" so Google doesnt realise its a link.