<?php
// Set the header
header("Content-Type: text/html; charset=utf-8");
// Use bin or src?
$strSources = '../bin';
// Import PRAjax
require_once($strSources . '/PRAjax.php');
// Instantiate PRAjax
$objPRAjax = new PRAjax($strSources . '/');
// Register functions
$objPRAjax->RegisterFunction('HelloWorld'); // This is something external and does not have to be implemented in this script file. Beware when using objects: they must be known on the current page!
$objPRAjax->ShowWaitCursor();
// Handle PRAjax client request
$objPRAjax->HandleClientRequest();
?>
<html>
<head>
<title>Hello World (Target: example_helloworld.php)</title>
<?php $objPRAjax->GetJavaScript(); ?>
<script language="JavaScript">
<!--
// Callback functions
function HelloWorld_cb(data) {
alert(data);
}
// -->
</script>
<style type="text/css">
<!--
body, p, td {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
}
h1 {
font-size: 22px;
font-weight: bold;
}
h2 {
font-size: 18px;
font-weight: bold;
}
-->
</style>
</head>
<body>
<div style="width: 100%; height: 65px; background-color: #EEEEEE; font-family: Arial, Helvetica, Sans-Serif; font-size: 9pt;">
This example calls PHP functions of example_helloworld.php
<br>
<a href="example_target.php.txt" target="_blank">View code...</a>
</div>
<form name="frmForm">
<h1>Hello World</h1>
<input type="button" value="Simple Hello World" onClick="HelloWorld(HelloWorld_cb, 'setPRAjaxTarget:example_helloworld.php;');">
</form>
</body>
</html>