Java Scripting for pop-ups???

This is a discussion on "Java Scripting for pop-ups???" within the JavaScript Forum section. This forum, and the thread "Java Scripting for pop-ups??? are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Mar 15th, 2005, 08:27
Junior Member
Join Date: Apr 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Java Scripting for pop-ups???

Hi, i have a question about coding an HTML with multiple pop-ups. Here is what I have so far:

<script language="JavaScript">
function pop(){
window.open("termsofuse.html","","height=792,width =612,left=0,top=0");
}
</script>

yes, this script is between both </HEAD>'s. Now, lets say I have 100 pop-ups, do I simply repeat the entire above script, change the "termsofuse.html" to whatever or is there another way? For example, like this?:

<script language="JavaScript">
function pop(){
window.open("termsofuse.html","","height=792,width =612,left=0,top=0");
}
</script><script language="JavaScript">
function pop(){
window.open("paymentpolicy.html","","height=792,wi dth=612,left=0,top=0");
}
</script>
<script language="JavaScript">
function pop(){
window.open("nondisclosure.html","","height=792,wi dth=612,left=0,top=0");
}
</script>

Or is there another way? I know this is a total noob question, but hey...at lleast i'm actually using code... Any help would be appreciated, thanks in advanced.

  #2 (permalink)  
Old Mar 15th, 2005, 08:59
New Member
Join Date: Mar 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Pop-ups

1. You can't have more than one function with exactly the same name.
2. You could have 100 functions with slightly different names, eg pop1(), pop2(), pop3(), etc but that is a tedious construct.
3. You could try one function with the filename passed as a string parameter

function pop(fname) {
window.open(fname,"","width= etc, etc,
}

and use this function with calls like pop("termsof use.html") or pop("paymentpolicy.html")
  #3 (permalink)  
Old Mar 15th, 2005, 11:05
Junior Member
Join Date: Apr 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
hmmm, like this?

<script language="JavaScript">
function pop(){
window.open("termsofuse.html", "nondisclosure.html", "etc.htm", "etc.html", "height=792,width=612,left=0,top=0");
}
</script>

What would be an example script?
  #4 (permalink)  
Old Mar 15th, 2005, 18:06
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Um, before getting to the how I'm curious about the why...

So, why so many popups? I'm guessing you don't need to do what you're trying to do in this way.
  #5 (permalink)  
Old Mar 15th, 2005, 20:23
New Member
Join Date: Mar 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Like I said above you need one javascript function in the head of your html file like

<script language=javascript type="text/javascript" >
<!--
function pop(fname) {
window.open(fname,"","width=792,height=612,left=0, top=0") ;
}

-->
</script>

and call this function with pop("termsof use.html"); or pop("paymentpolicy.html"); where necessary in the body of your HTML file.
  #6 (permalink)  
Old Mar 15th, 2005, 21:51
Junior Member
Join Date: Apr 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Cat, I decided to have other windows open in regards to viewing larger versions of art, documents, information, etc, as opposed to having everything enclosed in 1 Flash movie (waaaaay too large). If I put everything in 1 movie, it might be a 5 meg website, lol. Waaaay too big even with a pre loader.
  #7 (permalink)  
Old Mar 15th, 2005, 23:10
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
You should talk to sirkent about this. You can load parts of your site into your main Flash movie as needed.

loadMovie for example

Popups can be a problem in several ways, and you should avoid them whenever possible.
  #8 (permalink)  
Old Mar 16th, 2005, 04:07
Junior Member
Join Date: Apr 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
really? Wow, i did not know that. Well, I have no idea at this point how to do that (i barely know how to do the whole pop-up thing). Yes, originally I wanted to have something that loads a seperate file 'seperately' ('like' a pop-up) but not really a pop-up, ya know? It ouwl load in the movie as needed. I just have no clue how to code it in my html or what actionscript I have to use in my Flash movie, what to put for the buttons that link to what, etc., etc., CSS, PHP, ASP, BSB, JAVA, ???? If someone has a sample .fla or some scripts i can look at to study, that would be awesome too. Or maybe a site that I can look at the source or something. For now, I think the pop-ups would be easier to do (until i release v3.1 (an update, lol). Thanks.
  #9 (permalink)  
Old Mar 16th, 2005, 06:37
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Here's one tutorial: http://www.cbtcafe.com/flash/loadmovie/loadmovie.html

but there's plenty of others, and if you make a post in the Flash forum I'm sure you'll get all the help you need in using loadMovie. On the scale of doing things in Flash it's not too bad.
Closed Thread

Tags
java, scripting, popups

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
life scripting alexgeek Webforumz Cafe 17 Aug 26th, 2007 16:26
Flash scripting acrikey Flash & Multimedia Forum 7 Aug 11th, 2007 01:14
Java/GUI/Server Developer (Java, EJB/Hibernate, SWING) - Berkshire Web JobBot Job Opportunities 0 Jan 16th, 2007 09:30
scripting help berjoe Flash & Multimedia Forum 5 Oct 3rd, 2006 16:55
PHP scripting help please D3mon PHP Forum 9 Jun 14th, 2004 20:06


All times are GMT. The time now is 22:44.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43