Popup Picture Parameter Window

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Popup Picture Parameter Window
lindahlb
CZ Newbie
lindahlb has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Feb 23, 2004
0.00 posts per day
Posts: 1
Points: 104
   
Sorry, but I had to strip the HTML brackets to post this, I'm sure you can figure out where they'd go.

In index.html:
script language="JavaScript"
function openPictureWindow(pictureName) {
   settings = "width=0, height=0, top=0, left=0, titlebar=no, scrollbars=no, location=no, directories=no, status=no, menubar=no, toolbar=no, resizable=no";
   win = window.open("popup.html", "popup", settings);
   win.document.images["replaceImg"].src = pictureName;
   w = win.document.images["replaceImg"].width + 40;
   h = win.document.images["replaceImg"].height + 90;
   win.resizeTo(w, h);
   win.moveTo((screen.width) ? (screen.width - w) / 2 : 100, (screen.height) ? (screen.height - h) / 2 : 100);
   win.focus();
}
/script
a href="JavaScript:openPictureWindow('test.jpg')"Click here/a


In popup.html:
img name="replaceImg" border="4" src="loading.jpg"


Basically, what the script does, is open up 'popup.html' in a popup window and sets the main image in the popup window to the parameter image (in the example above, 'test.jpg'). It works fine when I'm testing it on my home computer (using the html files on my desktop), but when I upload it to a remote web server, I get the error:
Line: 6
Char: 2
Error: 'win.document.images.replaceImg' is null or not an object
Code: 0
Url: ---


The script is obviously stopping here:
win.document.images["replaceImg"].src = pictureName;

It can't find an image named "replaceImg" in the document.

I tried deleting the entire website and uploading the entire system of files for the website from my home computer, just in case there was a discrepency in the web files, but no luck (and yes, I refreshed before testing).

Anyone know why there's a discrepency between whats happening on the remote server and whats happening on my desktop? And more importantly, how do I fix this problem to get it working the way I need it to.

If I need to, I can post the website so someone can check the server side version of the pages, but I'd rather keep the website private while it's being developed.

Thanks,
Brian Lindahl

*First time poster*


Back to top Reply with quote
#2   re: Popup Picture Parameter Window
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
It was just quicker to make you one hope you dont mind.
[ Register or login to view links on this board. ]




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum