No, I'm saying that Javascript can't read or write files on the
client's machine, and that this is only one of a large number of
basic limitations in the language's capabilities. It would be
possible to write a script which took "$a = 3" and converted it into
"var a = 3", but a huge number of PHP functions either can't be
implemented in Javascript (file_get_contents) or are fundamentally
unsafe to implement in Javascript (mysql_query), so you'd end up with
a language you couldn't do anything with.
Evan
On Apr 26, 2006, at 5:07 PM, Warren Vail wrote:
Evan,
Are you proposing something like AJAX does? My understanding is
limited
here, so bear with me. A control like a hidden imbedded frame
(IFRAME) is
acted upon by Javascript to cause it to dynamically request loading
a page
into the frame, and when loaded, the javascript processes the
contents of
the frame without necessarily displaying it directly?
And then do the translation on the client?
Could work, but I was thinking more of doing the tranlation in a
function in
PHP, but that may be because PHP is my perspective. Something like;
--------------------------- snip --------------------------
Html stuff
<?php echo scripttranslate("
Php code follows here.... Careful with quotes"); ?>
More html stuff
--------------------------- snip --------------------------
Or
--------------------------- snip --------------------------
Echo "html stuff here"
.scripttranslate("php stuff here..."
." again carefull with quotes")
."more html stuff here"); // end of echo statement
--------------------------- snip --------------------------
Warren
-----Original Message-----
From: Evan Priestley [mailto:spam@xxxxxxxx]
Sent: Wednesday, April 26, 2006 1:47 PM
To: Warren Vail
Cc: PHP General List
Subject: Re: New Help with Javascript Navigation
Tell you what: write file_get_contents() in Javascript, and I'll
write the
rest of it.
Evan
On Apr 26, 2006, at 4:36 PM, Warren Vail wrote:
This brings up a reoccurring issue for me and I'd be interested if
anyone else has given it any thought.
PHP appears to me to be incomplete unless it can provide a way to
provide client (browser) side executables in a consistent language,
namely PHP.
Developers get all excited about the elegence of the PHP language,
and
somewhere along the way they discover they have been sandbagged (they
have to learn Javascipt too, if they want responsive GUI's).
One solution would be to develop a PHP Plugin and support that for
all
the browsers out there, but another just occurred to me. What if
there was a function that accepted PHP code as input and tranlated it
to Javascript, returning the resulting text ready for imbedding in
html?
Any creative masochists out there? Has it already been attempted?
Warren Vail
-----Original Message-----
From: Jay Blanchard [mailto:jblanchard@xxxxxxxxxx]
Sent: Wednesday, April 26, 2006 1:07 PM
To: Pub; php-general@xxxxxxxxxxxxx
Subject: RE: New Help with Javascript Navigation
Pub,
Thank you for subscribing to and participating in the PHP users list,
a place where your PHP questions can be answered. Unfortunately your
last post contained several problems;
a. It was to long.
2. it was a JavaScript question.
Thank you,
Jay
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php