There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Software Development
Tag Cloud
audio blue screen boot bsod computer cpu crash dell desktop driver drivers error excel external hard drive firefox freezes freezing hard drive hardware hijackthis internet internet explorer itunes laptop mac malware motherboard mouse network networking outlook 2007 power printer problem ram router screen slow sound trojan usb virus vista vista 32-bit windows windows vista windows xp winxp wireless wmp
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Javascript problem - help!


Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
DrWho53's Avatar
Junior Member with 4 posts.
 
Join Date: Sep 2003
29-Sep-2003, 02:34 PM #1
Unhappy Javascript problem - help!
Hi, first time visiting....I am having problems with a small "pop-up window"
javascript. It is a small pop-up window displaying a jpeg image. It works fine in I.E. but when viewed in Netscape all I get is a blank window - no image? I'm stumped!
Can anyone help? I would appreciate it!
Rollin' Rog's Avatar
Computer Specs
Moderator with 43,140 posts.
 
Join Date: Dec 2000
Location: North of Hollywoodland
Experience: I know when to fold em'
29-Sep-2003, 09:47 PM #2
Is this a problem you are having with a particular web site, or an application you have coded yourself?

If the latter, I'll move this to the "Development" forum.
DrWho53's Avatar
Junior Member with 4 posts.
 
Join Date: Sep 2003
29-Sep-2003, 11:15 PM #3
It's actually a bit of code downloaded from a "javascript site" for a pop-up window, that I pasted into my own website. Following the instructions it works find in I.E. but no image appears within the pop-up when viewed using Netscape? Thanks.
Rollin' Rog's Avatar
Computer Specs
Moderator with 43,140 posts.
 
Join Date: Dec 2000
Location: North of Hollywoodland
Experience: I know when to fold em'
29-Sep-2003, 11:35 PM #4
Okedoke, I'm going to move you to the "Development" forum.

You might want to include the code in an attached text file. OR encase it in "Code tags"

http://forums.techguy.org/misc.php?s=&action=bbcode
DrWho53's Avatar
Junior Member with 4 posts.
 
Join Date: Sep 2003
29-Sep-2003, 11:48 PM #5
Rollin Rog, thanks...below is the actual script I can't get to work properly in Netscape? It didn't imply that it only works in I.E. anywhere, just after the first paragraph below it does indicate "in other 4.x+ browsers" (I'm assuming then that it should work in Netscape also?)..or am I wrong?

Script: Amazing Frameless 'Peeker' Popup Window

Functions: In IE4 and later, this script launches a type
of window ad servers call a "peeker" popup --
which slowly rises into view from the bottom
of the screen. This is a frameless popup
window without the Windows frame or titlebar
(that is, a "containerless" window).

In other 4.x+ browsers, it launches a standard
popup window.

Positioning, width, height, speed, and many
other parameters are settable.

Automatic closing of the window on leaving the
page may also be optionally set.

Browsers: IE4 and later
Degrades functionally in other 4.x+ browsers

Author: etLux
==============================================================

STEP 1.
Inserting the <script> in your page

Put the following <script> </script> in the head
section of your launching page.

Set the variables as indicated in the script.

<script>

// Amazing Frameless Peeker Window
// (C) 2001 www.CodeLifter.com
// Free for all users, but leave in this header
// ----------------------------------------------

// set the popup window width and height

var windowW=214 // wide
var windowH=300 // high

// set vertical offset if you want the popup
// to rise above or stop below screen bottom;

var Yoffset=0 // in pixels, negative values allowed

// set the vertical motion parameters

var windowStep=2 // move increment (pixels)
var moveSpeed=10 // move speed (larger is slower)

// set the horizontal positioning of the window
// choices are left, center, right

Xmode="right";

// in left or right Xmode, set any offset from
// the screen edge here, if desired

Xoffset=35;

// set the url of the page to show in the popup

var urlPop = "yourpage.html"

// set the title of the page

var title = "This Is A Frameless Peeker";

// set this to true if the popup should close
// upon leaving the launching page; else, false

var autoclose = true

// ============================
// do not edit below this line
// ============================

var windowX = (screen.width/2)-(windowW/2);
if (Xmode=="left") windowX=0+Xoffset;
if (Xmode=="right") windowX=screen.availWidth-Xoffset-windowW;
var windowY = (screen.availHeight);
var windowYstop = windowY-windowH-Yoffset;
var windowYnow = windowY;

s = "width="+windowW+",height="+windowH;
var beIE = document.all?true:false

function openPeeker(){
if (beIE){
PFW = window.open("","popFrameless","fullscreen,"+s)
PFW.blur()
window.focus()
PFW.resizeTo(windowW,windowH)
PFW.moveTo(windowX,windowY)
var frameString=""+
"<html>"+
"<head>"+
"<title>"+title+"</title>"+
"</head>"+
"<frameset rows='*,0' framespacing=0 border=0 frameborder=0>"+
"<frame name='top' src='"+urlPop+"' scrolling=auto>"+
"<frame name='bottom' src='about:blank' scrolling='no'>"+
"</frameset>"+
"</html>"
PFW.document.open();
PFW.document.write(frameString)
PFW.document.close()
} else {
PFW=window.open(urlPop,"popFrameless","scrollbars,"+s)
PFW.blur()
window.focus()
PFW.resizeTo(windowW,windowH)
PFW.moveTo(windowX,windowY)
}
PFW.focus()
if (autoclose){
window.onunload = function(){PFW.close()}
}
movePFW();
}

function movePFW(){
if (document.all){
if (windowYnow>=windowYstop){
PFW.moveTo(windowX,windowYnow);
PFW.focus();
windowYnow=windowYnow-windowStep;
timer=setTimeout("movePFW()",moveSpeed);
}else{
clearTimeout(timer);
PFW.moveTo(windowX,windowYstop);
PFW.focus();
}
}else{
PFW.moveTo(windowX,windowYstop);
}
}

</script>

==============================================================

STEP 2.
Triggering the popup window

Call the openPeeker function from an onload event in the body
tag, like this:

<body onload="openPeeker()">

Note that the 'peeker' window will not start until the main
page from which it is launched has fully loaded.

==============================================================
Rockn's Avatar
Computer Specs
Distinguished Member with 17,888 posts.
 
Join Date: Jul 2001
Location: Mexico of the North, MN
Experience: Disenfranchised American Male
30-Sep-2003, 10:53 AM #6
That might be because of the framsets in the pop up window.
Rollin' Rog's Avatar
Computer Specs
Moderator with 43,140 posts.
 
Join Date: Dec 2000
Location: North of Hollywoodland
Experience: I know when to fold em'
30-Sep-2003, 02:28 PM #7
I can't evaluate the code very well myself, but my reading of the description would be that it is only meant for Internet Explorer.

Also, if you check this out:

http://www.webreference.com/js/column76/3.html

>> it appears the below code is checking to verify that the page is an IE page before executing its code:

var beIE = document.all?true:false


function openPeeker(){
if (beIE){

There is an "Else" statement, but I'm not sure what that does.
__________________
What The Dormouse Said

Donate

"Politicians, ugly buildings and whores all get respectable if they last long enough."
Rockn's Avatar
Computer Specs
Distinguished Member with 17,888 posts.
 
Join Date: Jul 2001
Location: Mexico of the North, MN
Experience: Disenfranchised American Male
30-Sep-2003, 03:12 PM #8
Kind of a convoluded piece of code to open a pop up window.
DrWho53's Avatar
Junior Member with 4 posts.
 
Join Date: Sep 2003
01-Oct-2003, 02:54 AM #9
Well, thanks to all who've replied...I guess it only works in I.E....does anyone know of a better piece of code to serve as a pop up window? If so, let me know....if there was only one browser to deal with, life would be so much simpler!
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 07:28 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.