SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2010
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to open page in javascript

    Hi I have a quastion I have the following function

    Code:
    function handleName(name){
    Here i want javascript to do following.
    open name.shtml target="_self"
    }
    How can this be done?

    Thanks

  2. #2
    SitePoint Enthusiast
    Join Date
    Jun 2010
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am currently doing this

    function handleName(name){
    top.location.href = (name.toLowerCase() + ".html");
    }

    but i get a invalid character error message, it works, but just wondering how to remove that error? It occured when I added that function.

  3. #3
    SitePoint Addict
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can't you just target your link inside your 'a' tag?
    <a href="yourlink" target="yourtarget">link</a>


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
  •