Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pop up not working

Status
Not open for further replies.

redmike

Technical User
Feb 25, 2002
46
IL
Hi,

90-1 that I should have posted this elsewhere but I wasn't sure where would be better. Following are two pages to provide a popup in the same page but it doesn't work so perhaps you could tell me why ?

---------------

<html>

<head>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=windows-1252&quot;>
<meta name=&quot;GENERATOR&quot; content=&quot;Microsoft FrontPage 4.0&quot;>
<meta name=&quot;ProgId&quot; content=&quot;FrontPage.Editor.Document&quot;>
<title>New Page 1</title>
<!--BEGIN Pop-up Images Script------------------------------------------->
<SCRIPT Language=&quot;JavaScript&quot;>
<!--
// Copyright 1999 - 2002 by Ray Stott, Pop-up Images Script ver 2.0
// OK to use if this copyright is included
// Script is available at
var pic = null
var popImg = null // use this when referring to pop-up image
var picTitle = null
var imgCount = 0
var imgWinName = &quot;popImg&quot;

function openPopImg(picName, windowTitle, windowWidth, windowHeight){
closePopImg()
picTitle = windowTitle
imgWinName = &quot;popImg&quot; + imgCount++ //unique name for each pop-up window
popImg = window.open(picName, imgWinName,
&quot;toolbar=no,scrollbars=no,resizable=no,width=&quot;
+ (parseInt(windowWidth)+20) + &quot;,height=&quot;
+ (parseInt(windowHeight)+15))
}
function closePopImg(){ // close pop-up window if it is open
if (navigator.appName != &quot;Microsoft Internet Explorer&quot;
|| parseInt(navigator.appVersion) >=4) //do not close if early IE
if(popImg != null) if(!popImg.closed) popImg.close()
}
function setStatus(msg){
status = msg
return true
}
//-->
</SCRIPT>

<SCRIPT Language=&quot;JavaScript1.1&quot;>
<!--
// for Netscape 3+ and IE 4+
var priorPic = new Array()
var noPic = 0
var foundit = false

function openPopImg(picName, windowTitle, windowWidth, windowHeight){
var i = 0
if(pic == picName && winOpen()){
popImg.focus()
}
else{
foundit = false
for(i=0; i<=noPic; i++){
if (priorPic == picName)
foundit = true
}
pic = picName
closePopImg()
picTitle = windowTitle
imgWinName = &quot;popImg&quot; + imgCount++ //unique name for each pop-up window
if(!foundit){
priorPic[noPic++] = pic
}
popImg = openPopImgWin(imgWinName, windowWidth, windowHeight)
}
}
function openPopImgWin(imgWinName, windowWidth, windowHeight){
var winFeatures = &quot;toolbar=no,scrollbars=no,resizable=no,width=&quot;
+ windowWidth + &quot;,height=&quot; + windowHeight
return window.open(&quot;pimg.htm&quot;, imgWinName, winFeatures)
}
function winOpen(){
if(popImg != null){
if(popImg.closed != true) return true; else return false
}
else
return false
}
//-->
</SCRIPT>

<SCRIPT Language=&quot;JavaScript1.2&quot;>
<!--
// Use this function to control placement of pop-up window
// in Netscape 4+ and Internet Explorer 4+
function openPopImgWin(imgWinName, windowWidth, windowHeight){
var leftX = 20 // distance of window's left side from left of screen
var topY = 20 // distance of window's top side from top of screen
var winFeatures = &quot;toolbar=no,scrollbars=no,resizable=no,width=&quot;
+ windowWidth + &quot;,height=&quot; + windowHeight
if (leftX>0){
winFeatures += &quot;,screenX=&quot; + leftX + &quot;,left=&quot; + leftX
+ &quot;,screenY=&quot; + topY + &quot;,top=&quot; + topY
}
return window.open(&quot;pimg.htm&quot;, imgWinName, winFeatures)
}
//-->
</SCRIPT>
<!--END Pop-up Images Script-------------------------------------------->

</head>

<body
<A HREF=&quot;JAVASCRIPT:eek:penPopImg('bigmap.jpg', 'Map', '355', '355')&quot;
onMouseOver=&quot;return setStatus('Click to display picture.')&quot;
onMouseOut=&quot;return setStatus('')&quot;>
<img src=&quot;map.jpg&quot; alt=&quot;Route&quot; width=&quot;123&quot; height=&quot;123&quot;></A></body>

</html>
-------------------

<HTML>
<HEAD>
<!--
This code is part of a Pop-up image Script that is
available at --->
<TITLE>Loading</TITLE>
<SCRIPT Language=&quot;JavaScript&quot;>
<!--
function fabricatePage(){
var htmlStr = 
'<HTML><HEAD><TITLE>' + window.opener.picTitle + '</TITLE></HEAD>'
+ '<BODY background=&quot;' + window.opener.pic + '&quot;></BODY></HTML>'
document.open()
document.write(htmlStr)
document.close()
}
//-->
</SCRIPT>
</HEAD>
<BODY bgcolor=&quot;#CCCCCC&quot; onLoad=&quot;fabricatePage()&quot;>
<SCRIPT Language=&quot;JavaScript&quot;>
<!--
if(!window.opener.foundit){
document.write(&quot;Loading Picture...<BR>&quot;)
document.write('<img src=&quot;' + window.opener.pic + '&quot; width=100% height=80%>')
document.close()

//-->
</SCRIPT>
</BODY>
</HTML>

-----------

The above pages are stored in the same folder as the two jpgs. I would also like to add another popup to my page which would not be an image file but could be either htm or txt.

thanks for your help,

Mike

The page will be used on my site at

 
This is not a technical forum. You want to re-post this in either &quot;-Web Site Designers&quot; or &quot;HTML and CSS (Cascading Style Sheets)&quot;
Jeff
I haven't lost my mind - I know it's backed up on tape somewhere ....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top