Click to See Complete Forum and Search --> : images/parameters


Nayias
11-11-2003, 10:41 AM
hey,
i have a function that opens a new window and then writes some text in the new window...
like this:

Script:

<script type="text/JavaScript">
function new_window(name, picurl, email)
{
var OpenWindow = window.open('','Profile',config='location=0,directories=0');

OpenWindow.document.write('<html><head><title>Profile</title></head>');

OpenWindow.document.write('Name: ' + name + '!');
OpenWindow.document.write('Email: ' + email);
}
</script>


FunctionCall:
<a href="#" onClick="new_window('Nayias','rf_crusher@hotmail.com','http://www.img.com/myimg.jpg')


but now i want an image with the url from the parameter (picurl)

how can i write the image with the correct url in the new_window?

grtz nayias

Jona
11-11-2003, 11:18 AM
<script type="text/javascript"><!--
function new_window(name,email,picurl){
var openWin = window. open('','Profile','location=0,directories=0');

with(openWin.document){
writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">');
write('<html><head><title>Profile</title></head>\n');

write('Name: ' + name + '!<br>');
write('Email: ' + email + "<br>");
write('<img src="'+picurl+'" alt="Image">\n');
write("</body></html>");
} }
//--></script>


[J]ona

Nayias
11-11-2003, 11:26 AM
ok thx:D

and then something else,
how can you open a window in his maximum size...?

Jona
11-11-2003, 06:25 PM
window.open("http://server.com/popup.html","popup","width="+screen.width+",height="+screen.height);


[J]ona

Nayias
11-12-2003, 09:33 AM
thx