Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 08-04-2009
Member
 
Join Date: Nov 2008
Posts: 996
Include a page with onclick

I want to generate (or include) a php page by clicking on a link but does not change the page with a link type <a href="#" onclick="XxXx">

I used the Code:
PHP Code:
onclick = "open (<?php $pge 'add_com'>)"
<script language="
JavaScript"> 
<!--
function open (url) {
<?php 
include (
$pge.'.php'); 
?>
}
// -->
</script>
But it does not
Reply With Quote
  #2  
Old 08-04-2009
XSI XSI is offline
Member
 
Join Date: May 2008
Posts: 271
Re: Include a page with onclick

Quote:
Originally Posted by CodGuru View Post
But it does not
Details? What does it display (error message), it does not produce the desired result, other (specify)?

Other:
JavaScript => Language executed later "client" (by the browser)
PHP => run server-side language.

What you want to look angrily at the AJAX
Reply With Quote
  #3  
Old 08-04-2009
Member
 
Join Date: May 2008
Posts: 685
Re: Include a page with onclick

The problem is that you do not understand how PHP works. PHP is executed server side, and JavaScript client-side. So the browser can not interact with PHP (it is obliged to sent an additional request).
Reply With Quote
  #4  
Old 08-04-2009
Member
 
Join Date: May 2008
Posts: 945
Re: Include a page with onclick

The answer is already given
Quote:
What you want to look angrily at the AJAX
With Ajax (Asynchronous JavaScript and XML), web applications can retrieve data from the server asynchronously in the background without interfering with the display and behavior of the existing page. Data is retrieved using the XMLHttpRequest object or through the use of Remote Scripting in browsers that do not support it. Despite the name, the use of JavaScript and XML is not actually required, nor do the requests need to be asynchronous.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Include a page with onclick"
Thread Thread Starter Forum Replies Last Post
How to include Webpage into your main page without using iFrame Sanju Baba Software Development 4 20-01-2012 10:56 AM
Can I include my all C drive?s page file on the other drive? DamarisK Operating Systems 3 24-07-2011 08:05 AM
CSS Button onclick event href="#" onclick=" Cornnelius Software Development 6 14-05-2010 11:20 PM
Onclick event with DIV tag ISAIAH Software Development 5 03-03-2010 04:45 PM
Include explicitly a jsp page in another MAHESA Software Development 5 02-12-2009 08:37 PM


All times are GMT +5.5. The time now is 08:06 PM.