SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Zealot Dwarf_Fighter's Avatar
    Join Date
    Mar 2003
    Location
    where I live
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    open a new address in the same window with JS

    Hi all,

    I have almost no knowledge of javascript.

    I use this, found in SP forums,

    <a href="java script:void" class="menu" onclick="window.open('http://www.domain.com/'); return false;">domain.com</a> for external links.

    Now i wonder if it is possible to open the address in the same window, not in a new window?

    Thanks for any idea in advance.
    [Important] I'm not from staff of sitepoint. BUT:
    Please do a search before you post a new thread. It is highly
    likely that, someone else has experienced your problem before
    and your answer lies in the archives.

  2. #2
    SitePoint Zealot
    Join Date
    Sep 2003
    Location
    Birmingham UK
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    change the onclick bit to:
    onlclick="window.location.href='http://www.domain.com';"

  3. #3
    SitePoint Zealot
    Join Date
    Sep 2003
    Location
    Birmingham UK
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    although thinking about it, why don't you use use a normal HTML link?

  4. #4
    SitePoint Zealot Dwarf_Fighter's Avatar
    Join Date
    Mar 2003
    Location
    where I live
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First, thanks for the quick response.

    I will use that for a link that I do not wish search engine spiders to follow.

    Many thanks again.
    [Important] I'm not from staff of sitepoint. BUT:
    Please do a search before you post a new thread. It is highly
    likely that, someone else has experienced your problem before
    and your answer lies in the archives.

  5. #5
    SitePoint Zealot Dwarf_Fighter's Avatar
    Join Date
    Mar 2003
    Location
    where I live
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey RichPearce,

    it results in a 5.0 IE browser with a 404 Error. Do you have any idea about it?
    Last edited by Dwarf_Fighter; Sep 2, 2003 at 03:27.
    [Important] I'm not from staff of sitepoint. BUT:
    Please do a search before you post a new thread. It is highly
    likely that, someone else has experienced your problem before
    and your answer lies in the archives.

  6. #6
    SitePoint Zealot Dwarf_Fighter's Avatar
    Join Date
    Mar 2003
    Location
    where I live
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    a deep search and my answer lies in the archives

    http://www.sitepointforums.com/showt...indow+location
    [Important] I'm not from staff of sitepoint. BUT:
    Please do a search before you post a new thread. It is highly
    likely that, someone else has experienced your problem before
    and your answer lies in the archives.

  7. #7
    SitePoint Zealot Dwarf_Fighter's Avatar
    Join Date
    Mar 2003
    Location
    where I live
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    arrrgghhh.. it does not work in IE 5.0
    [Important] I'm not from staff of sitepoint. BUT:
    Please do a search before you post a new thread. It is highly
    likely that, someone else has experienced your problem before
    and your answer lies in the archives.

  8. #8
    SitePoint Zealot
    Join Date
    Sep 2003
    Location
    Birmingham UK
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how about trying an alternative (and simpler) solution - stick this in between the <head></head> tags on the pages that you don't want indexed by a search engine:

    <meta name="robots" content="noindex,nofollow">

    when a spider sees noindex, it wont index it.
    the nofollow stops it from searching through any links referenced on the page.

  9. #9
    SitePoint Zealot
    Join Date
    Sep 2003
    Location
    Birmingham UK
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    alternatively, this will index the current page, but will not index any of the links contained on it:

    <meta name="robots" content="index,nofollow">

  10. #10
    SitePoint Zealot Dwarf_Fighter's Avatar
    Join Date
    Mar 2003
    Location
    where I live
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i just want some of my internal links not to be followed
    [Important] I'm not from staff of sitepoint. BUT:
    Please do a search before you post a new thread. It is highly
    likely that, someone else has experienced your problem before
    and your answer lies in the archives.

  11. #11
    SitePoint Zealot
    Join Date
    Sep 2003
    Location
    Birmingham UK
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you have a page with some links that you want indexed and some that you don't then use...

    <meta name="robots" content="noindex">

    ...in the head of any pages that you don't want indexed.


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
  •