Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: RE: FLASH: Perl/CGI script for popup
From: Eric Dunham
Date: Tue, 29 Feb 2000 02:07:03 GMT

First of all, IMNSHO, IE 4.5 for the Mac is hardly a step above crippleware
and a lot of the supposed support for different technologies simply isn't
there.
All that aside, here's a simple lesson on window opening.

The syntax of the statement is "window.open(URL, window_name, features);" I
won't go into all the features, those are listed all over the Web, and they
also aren't mandatory. Hell, the only thing that's mandatory is the URL
field. The URL field can actually be almost any kind of URL you want:
absolute, relative, targeted, querystring, etc. For my examples I shall
probably just use "#" because it's easy :) There are several ways to use
window.open(), but if you want to break it down into JS elements, you
basically have open() statements that occur dependent of and independent of
event handlers. Used in an independent scenario, you would just put
window.open("#"); in between a set of <script> tags and that would be it.
When the browser got to that line of the code (doesn't matter whether it was
line 3 or 3000) it would simply execute that statement, without any other
type of interaction or events occuring. The other type of open() is
event-driven, and you know you've seen these kind of events: onClick,
onLoad, etc. If there's an event handler for any object, you can open a
window with it. You could, for example do something like <img
src="something.gif" onabort="window.open('#');"> which would mean that you
could put a 6000x4000 pixel image on a webpage, and if the user didn't let
it load, and hit Stop or the Esc key or whatever, that event would trigger
and open up a new window containing the current document. I know that that's
a stupid example, but it illustrates a point. The most common kinds of
open()s however, are used within the <a> and <body> tags (Well, by the <a>
tag I mean link tags period, which could include form buttons). For the
<body> tag you would use <body onload="window.open('#');"> and when the body
was done loading all of its elements, it would open your window. The other
most common example is using the onclick event handler for form buttons and
link tags, like <a href="#" onclick="window.open('#'); return
false;">Whatever</a>. IMO, the better way to do it would be through the use
of a function, especially if you want a bunch of windows that have the same
dimensions, etc. but just have a different document displaying.
For example,
<script>
<!--
function launch(url,name){
window.open(url, name, "width=100, height=100");
}
//-->
</script>

would open a window 100px high and 100px wide when called. And to call that
function you would simply use "launch("#","my_window");" This kind of syntax
should work with any JavaScript-capable browser and with any of the basic
event handlers and objects that are widely supported.

HTH,
Eric Dunham

<snip>
I mean something that'll work on Mac IE 4.5. Is Perl an option? C++?
Something
that'll work like all the other popup windows do on Netscape. If someone has
a
javascript that is cross browser/platform with complete control of window
parameters (size, placement) that would be great, too.
</snip>


flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and The Flash Film Festival
"The World�s Premier Flash Solutions Conference and Expo"
March 27-29, Nob Hill Masonic Center, San Francisco, California

-Register before Feb 25 and save $200!!-- www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  Re: FLASH: Perl/CGI script for popup, Michael Dunn

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]