Forum Moderators: open

Message Too Old, No Replies

invalid argument in IE not Firefox or Safari

went through all the code and nothing.....

         

j05e

4:49 pm on Mar 31, 2010 (gmt 0)

10+ Year Member



<script language="JavaScript">
function launch(page) {
OpenWin = this.open(page, "my_gallery.swf", "toolbar=no, menubar=no, location=no, scrollbars=no, width=700, height=400");
}

</script>


i get an ivalid argument beginning with OpenWin....


i have

launch_btn.onRelease = function() {
getURL("javascript:launch('my_gallery.swf')");
}

Fotiman

5:12 pm on Mar 31, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Change this.open to window.open.

rocknbil

8:26 pm on Mar 31, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Besides that, there's something else.

The parameters are URL,ID,Window parameters. Your new window will open "page" with an id of "my_gallery.swf." The ID is used to insure new window always opens if the spawned windows are already open or to refer to if from other windows.


Not sure what you're doing with the SWF, but if it's what I think it is, something like this might work. The scenario is to pass the name of the .swf to a php script in a new window.

<a href="yourscript.php?f=my_gallery.swf" onclick="return my_win('my_gallery.swf');">See gallery</a>


function my_win(the_flash) {
var day=newDate;
var id=day.getTime();
var url = 'yourscript.php?f=' + the_flash;
var params = 'width=700,height=400,scrollbars,resizable';
var win=open(url,id,params);
return false;
}


Always allow your windows to have scrollbars and be resizable, it may look good to you but you never know what your user's environment will be and it can hide vital controls if you don't.