First off:
isn't right. There should be no space, but even so, unless you are unloading the page, you should use an onclick event.
Now your real question is about passing a parameter to the page via the function that contains the HTML of an object/embed tag combo.
You would probably be better off defining each possible (or just the one, if there is only one) such combo as a variable:
Code:
var pop_1='<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/ebu0OBa1pus&rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/ebu0OBa1pus&rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>';
Then passing that off to the function:
Code:
<a href="alternate.htm" onclick="dirtypop(pop_1);return false;">Generate</a>
The alternate.htm could have something on it for non-javascript enabled browsers.
Here's the amended script (you could have a pop_2, a pop_3, and so on, if you like):
Code:
<script type="text/javascript">
<!--
var pop_1='<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/ebu0OBa1pus&rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/ebu0OBa1pus&rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>';
function dirtypop(content)
{
var generator=window.open('','name','height=500,width= 500,status=1,resizable=0');
generator.document.write('<html><head><title>Popup </title>');
generator.document.write('</head><body>');
generator.document.write('<h1></h1>');
generator.document.write('<p></p>');
generator.document.write('<p>'+content+'</p>');
generator.document.write('<p><a href="javascript:self.close()">Close</a> the popup.</p>');
generator.document.write('</body></html>');
generator.document.close();
}
//-->
</script>
All this may still not avoid the 'click to activate' 'feature' (if that was even a consideration) in IE and Opera though, as that requires an external script, and this may or may not qualify as such to the browser.
Incidentally, what happened when you tried to alert the location of a page that technically has no href? In my experience, you would get:
about
:blank
or the href of the generating page.
Bookmarks