javascript code works for a little while

A

AAaron123

The code below opens the window and displays the image as a quick flash then
the image goes away and is replaced by a small icon.



Got any idea how to fix it?

thanks



function openWindow(name, path, w, h){

tmpTitle='title'

OpenWindow=window.open(
path,name,'location=0,resizable=1,width='+w+',height='+h);

OpenWindow.document.write('<html><head><'+tmpTitle+'>'+name+'</'+tmpTitle+'>');

OpenWindow.document.write('<link rel="stylesheet" href="style.css">');

OpenWindow.document.write('</head><body>');

OpenWindow.document.write('<p> <img ImageUrl="' + path+ '" /></p>');

OpenWindow.document.write('</body></html>');

OpenWindow.document.close();

}
 
G

George

try to replace ImageUrl with src
so instead of
OpenWindow.document.write('<p> <img ImageUrl="' + path+ '" /></p>');
it will be
OpenWindow.document.write('<p> <img src="' + path+ '" /></p>');

there is not such thing as ImageUrl in HTML.

George.
 
A

AAaron123

thanks, that fixed it. I got the code from the Internet. After the last line
"close" there was another line:

self.name="main"

I read the help but couldn't figure what it was for. Do you know? Should I
put it back?

thanks again
 
G

George

my guess this assigns name 'main' to the main window. So later child window
could refer to it by that name.
but you do not need it...

George.
 
A

AAaron123

thanks
George said:
my guess this assigns name 'main' to the main window. So later child
window could refer to it by that name.
but you do not need it...

George.
 
A

AAaron123

BTW. See how I handled <title>
If I use <title> </title> I get the error message that I can only have one
title

Are you familiar with that?

thanks again
 
G

George

Not sure where are you getting error message from...
Probably from Visual Studio..and it's not an error message it's probably a
warning...
Just ignore it... or disable validation of HTML altogeter... menu
Tools/Options/Validation...

George.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top