Jump to content

Recommended Posts

Hello, could anyone please provide me with a working example of a javascript that detects all of the active urls on the page and opens them in another window but has the option of opening all links normally? (without target="_blank").  So someone can click a link to disable links opening in a new window, but on default they will open in a new window.  Could you please provide a working example?  Thanks.

Would be easy enough to do using jQuery. Something like....

 

var newwindow = 'on'; // set this via a form or whatever.
$(document).ready(function() {
    $('a').each(function() {
        if (newwindow == 'on') {
            $(this).attr('target', '_blank');
        } else {
            $(this).attr('target', '_self');
        }
    });
});

Well sorry but I tried learning how to do this for many years but I just do not understand it.  If you only give me part of the code I cannot do anything with it.  I understand you do not have to do anything, but this is just a waste of time for us since I cannot do anything with half of a script.  Could anyone else help please?

but this is just a waste of time for us since I cannot do anything with half of a script.

The script that was posted previously was pretty much the whole thing written out for you except for a button/link that changes the status of a variable.

 

Can you post what you have tried so far? Most likely no one is going to help much  if you don't show have put in a bit of effort yourself

Well sorry but I tried learning how to do this for many years but I just do not understand it.  If you only give me part of the code I cannot do anything with it.  I understand you do not have to do anything, but this is just a waste of time for us since I cannot do anything with half of a script.  Could anyone else help please?

 

Go hire someone then.

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.