*** Nik Coughlin wrote/escribió (Mon, 16 Aug 2004 20:52:37 +1200):[color=blue]
> How can I partially update a page using javascript if javascript is
> available, but do a full update if it's not, using php?[/color]
Since PHP is a server-parsed language, there's no way to execute PHP code
without loading the page from the server. I guess you are looking for a
JavaScript trick called "iframe scripting": use these keywords in Google
and you'll probably find something.
--
-- Álvaro G. Vicario - Burgos, Spain
-- Questions sent to my mailbox will be billed ;-)
--
Nik Coughlin wrote:
[color=blue]
> How can I partially update a page using javascript if javascript is
> available, but do a full update if it's not, using php?[/color]
Jim has an example where JavaScript is used to question a server and a
normal HTTP form submission by the browser is done if script can't do
the job:
Alvaro G Vicario wrote:[color=blue]
> *** Nik Coughlin wrote/escribió (Mon, 16 Aug 2004 20:52:37 +1200):[color=green]
>> How can I partially update a page using javascript if javascript is
>> available, but do a full update if it's not, using php?[/color]
>
> Since PHP is a server-parsed language, there's no way to execute PHP
> code without loading the page from the server. I guess you are
> looking for a JavaScript trick called "iframe scripting": use these
> keywords in Google and you'll probably find something.
>[/color]
Hi Alvaro,
Looks like I didn't explain myself very well.
Somes sites use JavaScript to do a partial update, ie change text on a page,
make a message box appear etc. without reloading the whole page. What I
want to be able to do is, if they have JavaScript, load the page once and
from then on manipulate the dom when the page changes, without reloading the
page. However, if they don't have JavaScript, I want to construct a full
new page using php and load that instead. I've done this before with
Intraweb but I want to use PHP as the back end this time.
I'm not sure if what Martin suggested is what I mean, I will have a look
now.
Martin Honnen wrote:[color=blue]
> Nik Coughlin wrote:
>[color=green]
>> How can I partially update a page using javascript if javascript is
>> available, but do a full update if it's not, using php?[/color]
>
> Jim has an example where JavaScript is used to question a server and a
> normal HTTP form submission by the browser is done if script can't do
> the job:
> http://jibbering.com/2002/4/add.1[/color]
Hi Martin,
I don't know if I explained myself clearly enough, I have tried to do so in
my response to Alvaro's post, are we talking about the same thing? The
technique you have linked to looks like it could be very handy though.
Mybe simple concept: Your interactive buttons composed like <a
onclick="js_act ion();return false" href="php_actio n.php">..., with help
eg. phplib w'l little proffesional.
rw
Nik Coughlin wrote:
[color=blue]
> How can I partially update a page using javascript if javascript is
> available, but do a full update if it's not, using php?
>
>[/color]
rw wrote:[color=blue]
> Mybe simple concept: Your interactive buttons composed like <a
> onclick="js_act ion();return false" href="php_actio n.php">..., with
> help eg. phplib w'l little proffesional.
> rw
> Nik Coughlin wrote:
>[color=green]
>> How can I partially update a page using javascript if javascript is
>> available, but do a full update if it's not, using php?[/color][/color]
That's what I meant -- awesome. So, if JavaScript is available, the onclick
event fires, if not, the link calls a php script. Pretty simple, cool,
thanks!
Comment