473,412 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

javascript/php partial update

How can I partially update a page using javascript if javascript is
available, but do a full update if it's not, using php?
Jul 17 '05 #1
6 2331
*** Nik Coughlin wrote/escribió (Mon, 16 Aug 2004 20:52:37 +1200):
How can I partially update a page using javascript if javascript is
available, but do a full update if it's not, using php?


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 ;-)
--
Jul 17 '05 #2


Nik Coughlin wrote:
How can I partially update a page using javascript if javascript is
available, but do a full update if it's not, using php?


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

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 17 '05 #3
Alvaro G Vicario wrote:
*** Nik Coughlin wrote/escribió (Mon, 16 Aug 2004 20:52:37 +1200):
How can I partially update a page using javascript if javascript is
available, but do a full update if it's not, using php?


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.


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.
Jul 17 '05 #4
Martin Honnen wrote:
Nik Coughlin wrote:
How can I partially update a page using javascript if javascript is
available, but do a full update if it's not, using php?


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


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.

Thanks!
Jul 17 '05 #5
rw
Mybe simple concept: Your interactive buttons composed like <a
onclick="js_action();return false" href="php_action.php">..., with help
eg. phplib w'l little proffesional.
rw
Nik Coughlin wrote:
How can I partially update a page using javascript if javascript is
available, but do a full update if it's not, using php?

Jul 17 '05 #6
rw wrote:
Mybe simple concept: Your interactive buttons composed like <a
onclick="js_action();return false" href="php_action.php">..., with
help eg. phplib w'l little proffesional.
rw
Nik Coughlin wrote:
How can I partially update a page using javascript if javascript is
available, but do a full update if it's not, using php?


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!

Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Nik Coughlin | last post by:
How can I partially update a page using javascript if javascript is available, but do a full update if it's not, using php?
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
0
by: Daniel | last post by:
I wrote a pretty neat website today that can utilize no postback AJAXIAN type features. Basically to populate a drop down with a web service call that hits a SQL server, based off the change of...
1
by: Veerle | last post by:
Hi, I have a web page and at the end of the page I have inserted some javascript that checks if Acrobat Reader plugin is installed. If it is not installed, I disable some elements (buttons,...
5
by: Matthew Wilson | last post by:
I wrote some code to create a user and update a user on a remote box by sending emails to that remote box. When I was done, I realized that my create_user function and my update_user function were...
5
by: SAL | last post by:
Hello, I would like to be able to set the WHERE clause of a select statement on the fly. I have a DataAccess layer designed using the DataSet designer and a BusinessLogic layer using classes. The...
2
by: CrystalMikeMD | last post by:
Greetings, I've been at this problem for some time now and have decided to seek out some help. Essentially, this is what I have. A basic ASP.NET 2.0 page. On this page is the standard...
4
by: Peter | last post by:
ASP.NET I have an application which use ASP.NET Autocomplete extender which works great. But I have a question how to update all the fields on the screen using Ajax. Users starts typing in a...
2
by: pankajsingh5k | last post by:
Dear All, Please help me... I had read an article to lazy load a tab in a tabcontainer using an update panel on http://mattberseth.com/blog/2007/07/how_to_lazyload_tabpanels_with.html ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.