Results 1 to 4 of 4

Thread: Unable to target javascript location .href

  1. #1
    Join Date
    Feb 2009
    Posts
    78

    Unable to target javascript location .href

    Is it possible to use an anchor to open a new window using target="_blank" and at the same time to use inline javascript to redirect the page in the first window to the previous page? I would like to have it open in a new window, i.e. target="_blank" but the target idea does not work.

  2. #2
    Join Date
    Feb 2006
    Posts
    159

    Re: Unable to target javascript location .href

    You can ditch the hardcoded target attribute, as you intend to add it via the js anyway. I have been racking mt brain about this all day long and am having serious problems. Also, once the js function has done its thing, you want the browser to act upon the new href,

    location.href="vbchsub.htm" target="myiframe";
    location.href="vbchsub.htm"; target="myiframe";

    The rest, it seems it is an almagame of all the ideas and lacking coherence.

  3. #3
    Join Date
    Jan 2009
    Posts
    143

    Re: Unable to target javascript location .href

    If i want to load a page in an other target how must i do it??? with this script i can't give a target:

    script LANGUAGE="JavaScript" FOR="window" EVENT="onLoad()">
    <!--Window.location.href = "nobody" The one I really want to work is the one TSuji suggested.. does anyone have suggestions...

  4. #4
    Join Date
    Jan 2009
    Posts
    134

    Re: Unable to target javascript location .href

    In most cases, this will avoid problems with popup-blockers too. For most sites, Google is going to be the single most important non-js visitor they get. In most cases, this will avoid problems with popup-blockers too. If you want the href to be set dynamically, but also followable by search engines, then you need to look at ditching js for a server-side option, such as PHP. You don't need javascript...

    <a href="newpage.html" target="_blank">click here</a>

    A good rule of thumb is to build the site as if js didn't exist and then, once you've established that the site is accessible, usable and useful, lay on some js enhancements aimed at making the userflow even better for those with js-enabled UAs.

Similar Threads

  1. Set href value using javascript at onload
    By Jaganmohini in forum Software Development
    Replies: 4
    Last Post: 14-05-2010, 09:52 AM
  2. How do I cancel a href in javascript?
    By MAHESA in forum Software Development
    Replies: 6
    Last Post: 13-05-2010, 11:50 PM
  3. using href vs. onclick to call javascript function
    By Kalyug in forum Software Development
    Replies: 6
    Last Post: 12-05-2010, 10:09 AM
  4. onclick=location.href (new window)
    By Raja-Ji in forum Software Development
    Replies: 6
    Last Post: 12-05-2010, 10:04 AM
  5. Firefox Javascript Href issue
    By Lalitmohan in forum Software Development
    Replies: 5
    Last Post: 11-05-2010, 10:26 PM

Tags for this Thread

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
  •  
Page generated in 1,751,529,278.21375 seconds with 16 queries