HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
pop up windows for a FrontPage website
Goto page Previous  1, 2, 3, 4  Next
Post new topic   Reply to topic    HTML Help Forum Index -> General HTML
View previous topic :: View next topic  
Author Message
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8749
Location: Castle Pines North, CO USA

PostPosted: Mon Jun 21, 2004 6:31 pm     Reply with quote

Javascript works in very interesting ways. Smile I have a few people that I usually rely on for JS programming.
mjpliv



Joined: 11 May 2004
Posts: 402
Location: Nova Scotia

PostPosted: Tue Jun 22, 2004 2:46 am     Reply with quote

Are you saying that you doubled up the script in the head portion of the HTML? That shouldn't be required.
ambreeze



Joined: 19 Jun 2004
Posts: 19

PostPosted: Tue Jun 22, 2004 12:00 pm     pop up windows for a FrontPage website Reply with quote

Well, I DID try that, but it didn't work out too well. Then I tried just adding the second html address after where the first one was with a ";" between the addresses, but it didn't work either, so either you can't do that like that, or my syntax was wrong...

T.
mjpliv



Joined: 11 May 2004
Posts: 402
Location: Nova Scotia

PostPosted: Tue Jun 22, 2004 12:30 pm     Reply with quote

Are you using the version you posted the code for or the one Cory posted?
ambreeze



Joined: 19 Jun 2004
Posts: 19

PostPosted: Tue Jun 22, 2004 1:14 pm     pop up windows for a FrontPage website Reply with quote

I'm using the one I posted before - it was generated by the software on this site. But I removed the absolute addresses as suggested by you guys and it worked great. But both sections of code have the .html address in them. I know the second part of code (that refers to the onClick function) will ONLY have the address I want to have come up in it, but the first section will have the additional address - right?

I'll post the part that I think should have both addresses in it:

<script language='javascript'>
<!--
/********************************************
AUTHOR:WWW.CGISCRIPT.NET.LLC
URL:http://www.cgiscript.net
Use the code for FREE but leave this message intact
Download your FREE CGI/Perl Scripts today!
( http://www.cgiscript.net/scripts.htm )
****************************************************/
var acePopupWindow=null;
function acePopup(mypage,myname,w,h,pos,infocus){
if(pos=='random'){
LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=='center'){
LeftPosition=(screen.width)?(screen.width-w)/2:100;
TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!='random') || pos==null){LeftPosition=100;TopPosition=100;}settings='width='+ w + ',height='+ h + ',top=' + TopPosition + ',left=' + LeftPosition + ',location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=yes,resizable=no,dependent=no';
acePopupWindow=window.open('',myname,settings);
if(infocus=='front'){acePopupWindow.focus();acePopupWindow.location='popup_shorts.htm';}
}
//-->
</script>

I made bold the part where I think I should add the second .htm address, but I'm unsure of the syntax

OOOORRRRR, can't I do it like this?

T.
mjpliv



Joined: 11 May 2004
Posts: 402
Location: Nova Scotia

PostPosted: Tue Jun 22, 2004 1:30 pm     Reply with quote

I played around with the one Corey posted because there is no reference to any HTMl files for the popups in his javascript. I pasted it into a running test page I have for answering questions on this forum and uploaded it to my server. Its just a table with a mapped gif in the center. The links on the map don't go anywhere.

On the top there is a link for popup 1 and popup 2. These two popups use the same window.

On the bottom you will see links for popup 3 and popup4. These open in their own windows.

Look at the source code that Corey posted where the javascript function is created -

Code:
function NewWindow(mypage,myname,w,h,pos,infocus)


It creates the function called NewWindow that requires the variables mypage,myname,w,h,pos,infocus.

When you call the function in the link (look at my source code) -

Code:
<a href="javascript:NewWindow('popup1.html','test1popup','300','400','random','front');">POPUP 1</a>


the link calls for the function created in the javascript and feeds it the values of the variables. As long as I keep using the the same value for myname the popup will keep using the same window. As soon as I use a different string for myname (look at my source code for the bottom two links) it create a new popup window. You can play around with the infocus to alter the way the windows appear (foreground/background)
mjpliv



Joined: 11 May 2004
Posts: 402
Location: Nova Scotia

PostPosted: Tue Jun 22, 2004 1:32 pm     Reply with quote

By the way, I sent you down the garden path when I gave you the Apache link, its not compiled to run javascript. Sorry about that.

But you should be able to add the module.
mjpliv



Joined: 11 May 2004
Posts: 402
Location: Nova Scotia

PostPosted: Tue Jun 22, 2004 1:53 pm     Reply with quote

This is for Corey -

What are the possible values for the infocus variable and what do they do??
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8749
Location: Castle Pines North, CO USA

PostPosted: Wed Jun 23, 2004 5:18 am     Reply with quote

front or back I think are the only two. Front puts the pop-up in front.

I think that it is a lot more. If we could see the entire code on a website, it will be a lot easier. I think there might be some FP generated code somewhere that is corrupting it.
mjpliv



Joined: 11 May 2004
Posts: 402
Location: Nova Scotia

PostPosted: Wed Jun 23, 2004 5:32 am     Reply with quote

Corey, I think ambreeze was still trying to make the "canned" script work which referenced the popup HTML in the HEAD section of the script. Thats why ambreeze is having trouble with multiple popups. If the snipet of code you posted is used it works just fine as long as you use a unique value for myname for each popup window required. If the value for myname is the same in every link tag then the popup will use the same window over and over. The function NewWindow can be used in as many links as required.
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8749
Location: Castle Pines North, CO USA

PostPosted: Wed Jun 23, 2004 5:35 am     Reply with quote

As I recommended, use the wizard that was on the site & not the software. I had a lot of problems with it a few years ago & never looked at it again. The wizard works great for me & I have one site that uses numerous pop-ups.

With the wizard - there is no need to use multiple scripts in the head since the size of each pop-up is located in the body.
ambreeze



Joined: 19 Jun 2004
Posts: 19

PostPosted: Thu Jun 24, 2004 5:38 am     Reply with quote

I will try Corey's code with the other advise too, I'm sure it'll work just fine, and once again... THANKS!

Terri
mjpliv



Joined: 11 May 2004
Posts: 402
Location: Nova Scotia

PostPosted: Thu Jun 24, 2004 9:10 am     Reply with quote

Quote:
I played around with the one Corey posted because there is no reference to any HTMl files for the popups in his javascript. I pasted it into a running test page I have for answering questions on this forum and uploaded it to my server. Its just a table with a mapped gif in the center. The links on the map don't go anywhere.


I just realized I didn't post a link to the test site Embarassed -

http://www.buildersmatrix.com/info/map.html
ambreeze



Joined: 19 Jun 2004
Posts: 19

PostPosted: Thu Jun 24, 2004 4:36 pm     Reply with quote

very nice!

Hey, I just realized that YOU probably have colder weather than even I do... maybe Corey would be kind enough to write some kind of script that would send us some of his warm and sunny weather!

Confused

Terri
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8749
Location: Castle Pines North, CO USA

PostPosted: Thu Jun 24, 2004 5:37 pm     Reply with quote

You're kidding? I'm keeping that ALL to myself! LOL
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> General HTML All times are GMT - 8 Hours
Goto page Previous  1, 2, 3, 4  Next
Page 3 of 4

 
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
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
DARFUR
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial