RE: [PHP] How do I open a new JS window from a class-> ?
| From: | Maxim Maletsky | Date: | Fri, 01 Sep 2000 02:15:10 +0000 |
| Subject: | RE: [PHP] How do I open a new JS window from a class-> ? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-14719@lists.php.net to get a copy of this message | ||
Thanks, but the problem is that I want to have the JavaScript code entirely
inside the class..
so, only $foo ->foo(); is needed from the main script and the class will
open the window with some data in it.
The usability is the issue. I don't want to add JavaScript inside the main
script, it will be opening it by default in most cases and make it being in
the main class is not too comfortable making changes or moving it up and
down.
What is important that there's only a clean call to the class and when it's
appropriate a window pops up.
I kind of resolved it with fopen(), writing a new file and then opening it.
This is due the problem that the new window must belongs to one of the
files, which in this case can be or main script or the class. It would be
perfect to open new window of the same script, but with totally different
data it it, while having the script still loading.
I guess only, fopen can work, because what I want seems impossible to me.
If I want to redistribute the code or pass it to others, fopen will limit me
a lot, because you need to specify passes and you must have a writable
directory.
If you know how could I do that, please help me.
Thank you very much.
P.S: what I'm writing: it's a class that checks your script's load time.
Useful for developing purposes. It must be a multiplatform and will always
be moving from file to file. Will never stay on the same script forever. and
might be traveling between servers. the last call to the class should open a
new window with the info on how many milliseconds different intervals were
loading, so you can debug the heaviest parts.
I will pass it to you later on if you are interested in.
Cheers!
-----Original Message-----
From: Data Driven Design [mailto:jeff@datadrivendesign.com]
Sent: Monday, August 28, 2000 9:31 PM
To: Maxim Maletsky
Subject: Re: [PHP] How do I open a new JS window from a class-> ?
You have to use assignment to pass values to javascript
<script language="javascript">
<!--
var js_val = "<?php $foo->foo(); ?>";
var pop = window.open("","popup","width=200,height=100,toolbars=no");
pop.document.open();
pop.document.write(js_val);
pop.document.close();
pop.focus();
// -->
</script>
Maybe something like that will work, or
<script language="javascript">
<!--
var page = "page.php?var1=" + <?php echo urlencode($var1) ?> +
"&var2=" +
<?php echo urlencode($var2) ?>
var pop = window.open(page,"popup","...");
// -->
</script>
----- Original Message -----
From: "Maxim Maletsky" <maxim.maletsky@lincmedia.co.jp>
To: "PHP General List. (E-mail)" <php-general@lists.php.net>
Sent: Monday, August 28, 2000 1:04 AM
Subject: FW: [PHP] How do I open a new JS window from a class-> ?
>
> Sorry, I'm forwarding this to the list again, because I wasn't able to
find
> a solution for this thing...
>
> Could anyone help me with this?
>
>
> =========================================>>>
>
> Hi,
> I am trying to output the return value of a class, inside a new window,
> which I suppose is better to be a JavaScript's window.open() function..
>
> Now, it opens a file but not a peace of PHP or the class I'm working on...
>
> my question is: How can I open a new window having only 2 files: 1-The
> script, 2-The class included in that script.
>
> I don't want to create more files because the class later could be on
other
> different servers and called from several different scripts.
>
> Also I don't want to change the call $foo->foo(); to some kind of echo
> "whatever would include it..";, The output comes from the class...
>
> I would appreciate any help on this.
> Thank You...
>
> Maxim Maletsky - maxim@j-door.com
> <mailto:maxim@j-door.com>
> Webmaster, J-Door.com / J@pan Inc.
> LINC Media, Inc.
> TEL: 03-3499-2175 x 1271
> FAX: 03-3499-3109
>
> http://www.j-door.com
> <http://www.j-door.com/>
> http://www.japaninc.net
> <http://www.japaninc.net/>
> http://www.lincmedia.co.jp
> <http://www.lincmedia.co.jp/>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>