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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

i'm having a problem with this java

Status
Not open for further replies.

z35

Programmer
Dec 21, 2001
206
0
0
US
i'm having a problem with this javascript code. i have several buttons in flash, which, when pressed, open different pop-up windows.

i want one javacsript function to handle this. but this code is not working for me...it may be a bug. i'm still trying to get it to work.

in html doc, i wrote:

<script language=&quot;javascript&quot;>
function NewWindow(url,h,w) {
var winl = 0;
var wint = 0;
winprops =
'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=no'
win = window.open(url, 'win', winprops);}
}
</script>

and in my flash button action script i wrote:

on (press) {
getURL (&quot;javascript:NewWindow(photos/photoA.jpg',400,372)&quot;);
}
 
why are you putting the size of your windows in your buttons link?.also your targeting the file..shouldn't that be in the script itself?.when you target a function through javascript all you have to call is the function..atleast i think that is right..the function should be set up in the file inside the html that holds the links..something like:

Code:
on (press) {
    getURL (&quot;javascript:NewWindow()&quot;);
}
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
...window.open(url, 'win', winprops);}


there's an extra &quot;}&quot; in there! is that in the html page too?
 
you may be right rube...i'm going to try it out.

virt2002, the reason i am doing it this way is because i have several pop up windows and want to write only one javascript function that will handle all the windows...so...i HAVE to pass parameters.
 
Here you go :

Code:
<script language=&quot;javascript&quot;>
function NewWindow(url,h,w) {
    var winl = 0;
    var wint = 0;
    winprops =
 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=no'
    win = window.open(url, 'win', winprops);
    }
</script>

on (press) {
getURL (&quot;javascript:NewWindow('photos/photoA.jpg','400','372')&quot;);
}

The problem was you were missing the quotes around your parameters Regards

Big Bad Dave

davidbyng@hotmail.com
 
your right Dave! Thank you for your expert help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top