Page 1 of 2 12 LastLast
Results 1 to 15 of 20

Thread: Javascript Links

  1. #1
    Registered Mike's Avatar
    Join Date
    May 2003
    Location
    UK
    Posts
    2,755

    Javascript Links

    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

  2. #2
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    a javascript link can be made any number of ways

    <a href = "javascript:void" onclick = "window.open(url);">

    would be one.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  3. #3
    Registered Mike's Avatar
    Join Date
    May 2003
    Location
    UK
    Posts
    2,755
    Thanks,

    Will this mean my PR will not go down if I am linking to other sites please?
    Don't you just love free internet games ?

  4. #4
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    If you link like that, no it will not go down.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  5. #5
    Registered Mike's Avatar
    Join Date
    May 2003
    Location
    UK
    Posts
    2,755
    Thanks Chris...

    I have the following:

    Code:
    <a href = "javascript:void" onclick = "window.open('links.html');" class="cssclass" title="title of link">LINKS</a>
    Would that be OK please?

    Sorry for all the bother...
    Last edited by Mike; 05-09-2003 at 08:42 AM.
    Don't you just love free internet games ?

  6. #6
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    yes
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  7. #7
    Registered Mike's Avatar
    Join Date
    May 2003
    Location
    UK
    Posts
    2,755
    Thanks for all the help
    Don't you just love free internet games ?

  8. #8
    Junior Registered
    Join Date
    Sep 2003
    Posts
    3
    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?

    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>
    What is your opinions?

    Thanks in advance for any ideas

  9. #9
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    yes.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  10. #10
    Junior Registered
    Join Date
    Sep 2003
    Posts
    3
    what about this one?

    <a href="java script:void" class="menu" onclick="window.location.href='http://www.domain.com'; return false;">domain.com</a>

  11. #11
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    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.
    Last edited by Chris; 09-03-2003 at 05:46 AM.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  12. #12
    Junior Registered
    Join Date
    Sep 2003
    Posts
    3
    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

  13. #13
    Senior Member
    Join Date
    Jul 2003
    Posts
    774
    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

  14. #14
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    that'd still open another window,

    using top.href or self.href should work without opening another window.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  15. #15
    Registered Mike's Avatar
    Join Date
    May 2003
    Location
    UK
    Posts
    2,755
    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?

    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>
    Thanks,
    Mike
    Last edited by Chris; 12-12-2003 at 11:58 AM.
    Don't you just love free internet games ?

Similar Threads

  1. Script to turn all links into javascript or redirects
    By Westech in forum Website Programming & Databases
    Replies: 5
    Last Post: 10-20-2014, 04:34 PM
  2. How Do You Use Javascript Links?
    By incka in forum Search Engine Optimization
    Replies: 27
    Last Post: 12-27-2003, 03:28 PM
  3. How many links are too much?
    By emke in forum Search Engine Optimization
    Replies: 15
    Last Post: 11-26-2003, 07:34 PM
  4. Do javascript links still "refer" ?
    By Percept in forum Search Engine Optimization
    Replies: 2
    Last Post: 11-12-2003, 06:03 PM
  5. Affiliate Links Using Javascript
    By Mike in forum Advertising & Affiliate Programs
    Replies: 4
    Last Post: 08-18-2003, 09:17 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •