If you are seeing this message, it is possible the page did not load properly. Please hit reload/refresh on your browser.
If you still see this message, you probably do not have a browser that supports web standards, although its content is accessible to any browser or Internet device.

Cool Tips & Tricks Cool Tips & Tricks

Help Communities:
Help Forums Bug Base
<< Prev Topic | Next Topic >>
Cool Tips & Tricks ::: HTML ::: new window question
New Topic    Add Reply
Topic: new window question  (?)  Click to receive email notification of replies Click to stop receiving email notification of replies email this topic to a friend
AngelT271

Registered User
ezSupporter
Posts: 14
Posted: 11/5/05 3:19 pm    
new window question
I have looked for the script that enables all links to open in a new window , but I cant find it . Can somebody please help me


  reply to this message

Nutrocker

ezboard Moderator
ezSupporter
Posts: 16433
Posted: 11/5/05 3:50 pm    
Re: new window question
offsite links, not all links.
p079.ezboard.com/fcooltip...=223.topic


  reply to this message

AngelT271

Registered User
ezSupporter
Posts: 14
Posted: 11/5/05 4:50 pm    
Re: new window question
thank you very much


  reply to this message

Scott Bull

Registered User
ezSupporter
Posts: 37
Posted: 11/19/05 7:19 am    
Re: new window question
Sometimes for me it doesn't open offsite links in new windows, and will open on-site links in ner windows, is there a possible bug with this coding, (it only rarely happens, and seems to be random).


  reply to this message

Nutrocker

ezboard Moderator
ezSupporter
Posts: 16531
Posted: 11/19/05 3:52 pm    
Re: new window question
The code does nothing for onsite links as far as I am aware. And some onsite links can be coded to launch in a new window or not anyway as far as I know.

But yes, it could be a little buggy or it could be down to the browser or a number of things.


  reply to this message

Scott Bull

Registered User
ezSupporter
Posts: 38
Posted: 11/20/05 2:56 pm    
Re: new window question
Even the same links change, I got a link for NeoPets, sometimes it opens in a new window, sometimes it opens in the same window.


  reply to this message

Nutrocker

ezboard Moderator
ezSupporter
Posts: 16539
Posted: 11/20/05 4:13 pm    
Re: new window question
Sounds like the code may be buggy then.


  reply to this message

Scott Bull

Registered User
ezSupporter
Posts: 41
Posted: 11/20/05 9:22 pm    
Re: new window question
That and I can't believed I just admitted to playing NeoPets online, lol.


  reply to this message

chrish18

Registered User
ezSupporter
Posts: 2280
Posted: 11/21/05 10:16 am    
Re: new window question
Not buggy, it uses onload, so if the page doesnt load completelt then the code doesnt execute.

You can try removing the onload line and call the function from the footer instead.


  reply to this message

Scott Bull

Registered User
ezSupporter
Posts: 43
Posted: 11/23/05 12:30 pm    
Re: new window question
I understand your first statement, but not the second one, could you please explain it more?


  reply to this message

chrish18

Registered User
ezSupporter
Posts: 2297
Posted: 11/23/05 12:40 pm    
Re: new window question
Replace this in box 1
 
<script type="text/javascript">
function redirect()
{
  for (k = 0; k < document.links.length; k++) {
    if (document.links[k].href.toLowerCase().indexOf("javascript") == -1) {
      if (document.links[k].hostname != self.location.hostname) {
        document.links[k].target = "_blank"
        } else { 
        document.links[k].target = "_self"
      }
    }
  }
}
window.onload = redirect;
</script>
with this in box 4
 
<script type="text/javascript">
function redirect()
{
  for (k = 0; k < document.links.length; k++) {
    if (document.links[k].href.toLowerCase().indexOf("javascript") == -1) {
      if (document.links[k].hostname != self.location.hostname) {
        document.links[k].target = "_blank"
        } else { 
        document.links[k].target = "_self"
      }
    }
  }
}

redirect();
</script>


  reply to this message

Scott Bull

Registered User
ezSupporter
Posts: 44
Posted: 12/1/05 2:58 pm    
Re: new window question
Could you explain what this does exactly, since the other one only fails if the page is broken, how does this one differ?


  reply to this message

Nutrocker

ezboard Moderator
ezSupporter
Posts: 16611
Posted: 12/1/05 3:54 pm    
Re: new window question
The second code does not use the onload function so it does not care if the page does not load fully.


  reply to this message

Scott Bull

Registered User
ezSupporter
Posts: 44
Posted: 12/2/05 7:34 am    
Re: new window question
Excellent, and it works a treat and seems to load faster too, I take I was to remove the 1st section and put it in the 4th section, (either way, it's working).

Cheers, it's really helped.

Edited by: Scott Bull at: 12/2/05 7:38 am

  reply to this message

Nutrocker

ezboard Moderator
ezSupporter
Posts: 16621
Posted: 12/2/05 3:48 pm    
Re: new window question
I have added the new script to the FAQ as an alternative choice.


  reply to this message

Scott Bull

Registered User
ezSupporter
Posts: 46
Posted: 12/3/05 4:02 pm    
Re: new window question
Cool, hopefully it'll be as helpful to others too.

Wouldn'tit be more convenient though if it was standard for EzBoard that all links opened in new windows.


  reply to this message

Nutrocker

ezboard Moderator
ezSupporter
Posts: 16627
Posted: 12/3/05 4:08 pm    
Re: new window question
Well, in an ideal world it would be an option for board admins to choose..


  reply to this message

Scott Bull

Registered User
ezSupporter
Posts: 47
Posted: 12/4/05 11:13 am    
Re: new window question
But in the most part, new windows would be the better option, for example,when you do stuff like quizes or whatever, and you intend to post your results, if it opened in the same window, you'd either have to click BACK a few times or re-type in the URL.

Incidently, the 2nd code seems to affect pop-up blockers slightly, I'll look into this in my spare time....when I get some.


  reply to this message

Te1emachus

Registered User
Posts: 892
Posted: 12/4/05 1:41 pm    
Re: new window question
That's why tabbed browsing is so useful. ;)


  reply to this message

Scott Bull

Registered User
ezSupporter
Posts: 50
Posted: 12/7/05 12:02 pm    
Re: new window question
Smarty pants.

Alternativly, just use the code, lol.


  reply to this message

Click to receive email notification of replies Click to stop receiving email notification of replies email this topic to a friend

New Topic    Add Reply

jump to:
Topic Control Image::: Topic Commands
<< Prev Topic | Next Topic >>

Icon Legend

reply button:::Reply to Post Button   edit button:::Edit Post Button  delete button:::Delete Post Button (Moderator Only)

subscribe/unsubscribe to thread button:::Subscribe to Thread Button   email to friend button:::Email to Friend Button  



- Cool Tips & Tricks - HTML -

Communitiesezboard Help Communities:

Help Forums Help Forums Bug Base Bug Base





Powered By ezboard® Ver. 7.32
Copyright ©1999-2007 ezboard, Inc.