<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi guys!<br>
<br>
Im trying to open document links - '<a class="ep_ducument_link"
href="...' - in a pop up window (not a new tab), but I can't figure
out how to do this in prototype.<br>
<br>
In jquery i do this:<br>
<br>
<font color="#3366ff">jQuery(document).ready(function($) {<br>
jQuery('a.ei_popup').live('click', function(){<br>
newwindow=window.open($(this).attr('href'),'','height=575,width=720');<br>
if (window.focus) {newwindow.focus()}<br>
return false;<br>
});<br>
});</font><br>
<br>
which does the trick.<br>
<br>
I am totally new to prototype, but I found this snippet, that is
supposed to do the same:<br>
<br>
<font color="#ff0000">document.observe("dom:loaded", function() {<br>
function new_window_links(){<br>
links = $$("a.ep_document_link");<br>
links.each(function(link){<br>
link.observe("click", function(event){<br>
window.open(link.href);<br>
event.stop();<br>
});<br>
});<br>
}<br>
});</font><br>
<br>
But it doesn't do anything. I checked the source code, and the code
does load fine from 90_local.js.<br>
<br>
Thanks in advance, help and pointers will be greatly appreciated.<br>
<br>
Have a nice day!<br>
<div class="moz-signature">-- <br>
<p style="color:#999;"><strong>Med venlig hilsen/Best regards</strong></p>
<p style="color:#999;"><strong>JACOB WENZEL<br>
Projektleder</strong></p>
<p style="color:#999;"><strong>ENERGIAKADEMIET</strong><br>
Strandengen 1<br>
8305 SAMSØ<br>
+45 60 61 15 97<br>
<a style="color:#999; text-decoration:none;"
href="mailto:jw@energiakademiet.dk">jw@energiakademiet.dk</a><br>
<a style="color:#999; text-decoration:none;"
href="http://energiakademiet.dk">www.energiakademiet.dk</a><br>
</p>
</div>
</body>
</html>