On Tue, 18 Mar 2003 15:59:32 -0700, Kevin Stone wrote about "Re: [PHP] php
and javascript" what the universal translator turned into this:

>----- Original Message -----
>From: "Antoine" <[EMAIL PROTECTED]>
>To: "php list" <[EMAIL PROTECTED]>
>Sent: Tuesday, March 18, 2003 3:52 PM
>Subject: [PHP] php and javascript
>
>> I wrote a function to redirect my page to another one.   But for some
>> reason I keep getting an error.
>> here is the function I made
>>
>> function js_pointer_login($thepage)
>> {
>>  echo '<script language="javascript">  window.location = '$thepage'
>> </script>';
>> }
>> --
>> Antoine <[EMAIL PROTECTED]>
>
>Three fundemental flaws:
>1) single quotes in PHP denote a litteral string so $thepage will not be
>parsed
>2) the first single quote before $thepage will end the echo statement
>anything after that is a parse error
>3) the proper javascript syntax to redirect to a url within the active
>window is window.location.href="";

parent.location.href=""

works just as fine ... and it's also portable directly to frames
sub-files.

Oh, and in JavaScript the end-line ; markers aren't used ... they're
ignored mostly, but some older browsers caugh and spit at them ... JS
standard doesn't require them, but because they're used in Java and
JScript, the newer JIT compilers just ignore them...

Rene

-- 
Rene Brehmer

This message was written on 100% recycled spam.

Come see! My brand new site is now online!
http://www.metalbunny.net

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to