Comments on: Putting Links in New Windows http://isaacschlueter.com/2004/09/new_window_links/ Just slightly more than my twitter stream. Fri, 20 Nov 2015 19:11:36 +0000 http://wordpress.org/?v=2.5.1 By: Isaac http://isaacschlueter.com/2004/09/new_window_links/#comment-1616 Isaac Mon, 09 Oct 2006 18:01:58 +0000 #comment-1616 Alto: If you need to control the attributes of the popup windows, then please see this page: http://isaacschlueter.com/2005/05/new_window_links_2/ Alto:

If you need to control the attributes of the popup windows, then please see this page:
http://isaacschlueter.com/2005/05/new_window_links_2/

]]>
By: altoyes http://isaacschlueter.com/2004/09/new_window_links/#comment-1611 altoyes Mon, 09 Oct 2006 07:23:08 +0000 #comment-1611 hi isaac: i am using your script as is as my wrong alterations to your script mess up my other popup windows - the poplinks are all on the right right sidebar http://parentsawake.com/ the popup script is from http://incsub.org/feed2js/index.php?s=build yet i would really love to get your windows to open as my other popup windows. alto hi isaac:
i am using your script as is as my wrong alterations to your script mess up my other popup windows - the poplinks are all on the right right sidebar
http://parentsawake.com/

the popup script is from http://incsub.org/feed2js/index.php?s=build

yet i would really love to get your windows to open as my other popup windows.

alto

]]>
By: altoyes http://isaacschlueter.com/2004/09/new_window_links/#comment-1610 altoyes Mon, 09 Oct 2006 07:05:39 +0000 #comment-1610 hi isaac this is probably more like it, though i don't have it working yet. <code> function PopWin(e) { if (window.event && window.event.srcElement) a = window.event.srcElement else if (e && e.target) a = e.target if (!a) return; a = getParent(a,'a'); // Open a new window with the link's href. var features = "toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,status=yes,resizable=yes,width=500,height=400"; var newwin = window.open(a.href, features); // The thought is that if the new window didn't (popups blocked or whatever) // we want to return true so the link is follow normally. if( newwin ) { if( e.returnValue ) e.returnValue = false; if( e.preventDefault ) e.preventDefault(); return false; } else return true; } </code><code></code> hi isaac

this is probably more like it, though i don’t have it working yet.


function PopWin(e) {
if (window.event && window.event.srcElement) a = window.event.srcElement
else if (e && e.target) a = e.target
if (!a) return;

a = getParent(a,'a');
// Open a new window with the link's href.
var features = "toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,status=yes,resizable=yes,width=500,height=400";
var newwin = window.open(a.href, features);

// The thought is that if the new window didn't (popups blocked or whatever)
// we want to return true so the link is follow normally.
if( newwin )
{
if( e.returnValue ) e.returnValue = false;
if( e.preventDefault ) e.preventDefault();
return false;
}
else return true;
}

]]>
By: altoyes http://isaacschlueter.com/2004/09/new_window_links/#comment-1609 altoyes Mon, 09 Oct 2006 03:51:31 +0000 #comment-1609 hi again isaac for example: might i do this? to the popup windows section of the script? <code> function PopWin(e) { if (window.event && window.event.srcElement) a = window.event.srcElement else if (e && e.target) a = e.target if (!a) return; a = getParent(a,'a'); // Open a new window with the link's href. var newwin = window.open(a.href); // Open a new window with the link’s href. var newwin = window.open(a.href)(features = scrollbars,status,resizable,top=50,left=50,height=200,width=300); // The thought is that if the new window didn't (popups blocked or whatever) // we want to return true so the link is follow normally. if( newwin ) { if( e.returnValue ) e.returnValue = false; if( e.preventDefault ) e.preventDefault(); return false; } else return true; } </code><code></code> hi again isaac

for example:
might i do this? to the popup windows section of the script?


function PopWin(e) {
if (window.event && window.event.srcElement) a = window.event.srcElement
else if (e && e.target) a = e.target
if (!a) return;

a = getParent(a,'a');
// Open a new window with the link's href.
var newwin = window.open(a.href);
// Open a new window with the link’s href.
var newwin = window.open(a.href)(features = scrollbars,status,resizable,top=50,left=50,height=200,width=300);

// The thought is that if the new window didn't (popups blocked or whatever)
// we want to return true so the link is follow normally.
if( newwin )
{
if( e.returnValue ) e.returnValue = false;
if( e.preventDefault ) e.preventDefault();
return false;
}
else return true;
}

]]>
By: altoyes http://isaacschlueter.com/2004/09/new_window_links/#comment-1608 altoyes Mon, 09 Oct 2006 02:16:11 +0000 #comment-1608 hi issac thankyou for the script. i have it working. all external links are opening in a new window. i need to be able to add attributes to the window. can i do that with your script? if so, could you give me detail as i am having difficulty understanding the language. alto hi issac
thankyou for the script.
i have it working. all external links are opening in a new window.

i need to be able to add attributes to the window.
can i do that with your script?

if so,
could you give me detail as i am having difficulty understanding the language.

alto

]]>
By: Isaac Schlueter http://isaacschlueter.com/2004/09/new_window_links/#comment-54 Isaac Schlueter Tue, 30 Nov 1999 00:00:00 +0000 #comment-54 I just added the <code>getParent</code> function to deal with a strange Mozilla bug where sometimes the #text node is the target of the click event, instead of the A. I just added the getParent function to deal with a strange Mozilla bug where sometimes the #text node is the target of the click event, instead of the A.

]]>
By: scott http://isaacschlueter.com/2004/09/new_window_links/#comment-55 scott Tue, 30 Nov 1999 00:00:00 +0000 #comment-55 Isaac, Thanks for the post. I have implemented the script, which is very easy to do. Aside from needing to recode the few pop-ups that I have (using either a js function or window.open js in the HTML), it went very smoothly. I do have a question. <strong>Is there a way to insert a link so as to uniquely control the position/size of the 'newwin' popUp window?</strong> (The few, exsiting popUps I had, defined size/position on a per-case basis and I would like to retain this capability). I can't seem to quickly find a way to do this, using this script and retaining graceful degredation in the event a visitor has JS turned off. Thanks. -Scott Isaac,

Thanks for the post. I have implemented the script, which is very easy to do.

Aside from needing to recode the few pop-ups that I have (using either a js function or window.open js in the HTML), it went very smoothly.

I do have a question.

Is there a way to insert a link so as to uniquely control the position/size of the ‘newwin’ popUp window? (The few, exsiting popUps I had, defined size/position on a per-case basis and I would like to retain this capability).

I can’t seem to quickly find a way to do this, using this script and retaining graceful degredation in the event a visitor has JS turned off.

Thanks.

-Scott

]]>
By: Schlueterica http://isaacschlueter.com/2004/09/new_window_links/#comment-56 Schlueterica Tue, 30 Nov 1999 00:00:00 +0000 #comment-56 <strong>Putting Links in New Windows, part II</strong>I got an interesting comment from Scott of http://randsco.com regarding my Putting Links in New Windows article. Is there a way to insert a link so as to uniquely control the position/size of the 'newwin' popUp window? Currently, no. However, if... Putting Links in New Windows, part III got an interesting comment from Scott of http://randsco.com regarding my Putting Links in New Windows article.

Is there a way to insert a link so as to uniquely control the position/size of the ‘newwin’ popUp window?

Currently, no. However, if…

]]>
By: Justin Haugens http://isaacschlueter.com/2004/09/new_window_links/#comment-57 Justin Haugens Tue, 30 Nov 1999 00:00:00 +0000 #comment-57 Hey Isaac, I tried to enter the codes into my blog but I'm not 100% sure where it's suppose to go. Should it be in the custom.css file in b2evolution? Any specific location in there? I am hoping we can get this to work because it will save me a lot of time!!! Hey Isaac, I tried to enter the codes into my blog but I’m not 100% sure where it’s suppose to go. Should it be in the custom.css file in b2evolution?

Any specific location in there? I am hoping we can get this to work because it will save me a lot of time!!!

]]>
By: Isaac Schlueter http://isaacschlueter.com/2004/09/new_window_links/#comment-58 Isaac Schlueter Tue, 30 Nov 1999 00:00:00 +0000 #comment-58 Justin, Check out <a href="http://isaacschlueter.com/tests/standardspoppin.html" rel="nofollow">the test page</a> and view the source. The best thing to do is put all the JavaScript code in a separate popup.js file. Save this file in your <code>/skins/skin_name/</code> folder (where <code>skin_name</code> is the name of the skin that you're using it with.) Then, in <code>/skins/skin_name/_main.php</code>, add something like this right after the <code><head></code> tag: <code><script type="text/javascript" src="popup.js"></script></code> Justin,

Check out the test page and view the source.

The best thing to do is put all the JavaScript code in a separate popup.js file. Save this file in your /skins/skin_name/ folder (where skin_name is the name of the skin that you’re using it with.)

Then, in /skins/skin_name/_main.php, add something like this right after the <head> tag:
<script type="text/javascript" src="popup.js"></script>

]]>

Warning: fopen(/var/www/isaacschlueter.com/public/wp-content/cache/meta/wp-cache-2b17ecf7733f38ddabff8593077e5fb1.meta) [function.fopen]: failed to open stream: Permission denied in /var/www/isaacschlueter.com/public/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 378

Warning: fputs(): supplied argument is not a valid stream resource in /var/www/isaacschlueter.com/public/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 379

Warning: fclose(): supplied argument is not a valid stream resource in /var/www/isaacschlueter.com/public/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 380