Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder DR.Wong's Avatar
    Join Date
    Jan 2005
    Posts
    360
    Thanks
    23
    Thanked 1 Time in 1 Post

    Simple Question : window.location target??

    Hey there,

    I'm using a very simple redirect for printing a printer-friendly version of some information.

    I use a frame so that the page is hidden from the user.

    The redirect I am using is :

    Code:
    <body onload="window.location='example.htm'">
    This works great for me as I don't need any extra JS, just this quick, simple solution.

    My question is, how can I add a target="_top" to the redirect to break out of the frames?

    Thanks a lot!
    -DR.Wong

    Wheres the food at?

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    You may have to use window.open() (though I'm not sure about the purpose)
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Master Coder
    Join Date
    Feb 2003
    Location
    Umeå, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Oh, try to use top.location=...
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • Users who have thanked liorean for this post:

    DR.Wong (08-25-2008)

  • #4
    Regular Coder DR.Wong's Avatar
    Join Date
    Jan 2005
    Posts
    360
    Thanks
    23
    Thanked 1 Time in 1 Post
    Thanks liorean!

    That works like a charm.
    -DR.Wong

    Wheres the food at?

  • #5
    New Coder
    Join Date
    Jan 2007
    Location
    Chennai, Tamil Nadu, India
    Posts
    71
    Thanks
    5
    Thanked 0 Times in 0 Posts

    browsers block popup windows

    window.open will open in new window... what if the browser is set to block the popup... whereas hyperlinks target=_blank works fine and why not a javascript code other than window.open...??? or we have to trigger a hyperlink event on an hyperlink which is set open in new window.... phew...
    http://vikku.info/
    - யானைக்கும் அடிசறுக்கும்


  •  

    Posting Permissions

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