I have a question/problem. I've read this over and over untill my eyes hurt, and I can't seem to get it to work. Here is the code I'm using:
test.js includes:
Code:
My_AJAX_Object = new vB_AJAX_Handler(true);
My_AJAX_Object.onreadystatechange(My_AJAX_Reciever);
function My_AJAX_Reciever()
{
if (My_AJAX_Object.readyState == 4 && My_AJAX_Object.status == 200 && My_AJAX_Object.responseText)
{
alert('Data recieved successfully\n\n' + My_AJAX_Object.responseText)
}
}
My_Variable = PHP.urlencode(My_Variable);
My_AJAX_Object.send('test.php', 'do=ajax&pagevar=text');
My PHP file contains:
PHP Code:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'test');
// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();
// get special data templates from the datastore
$specialtemplates = array();
// pre-cache templates used by all actions
$globaltemplates = array();
// pre-cache templates used by specific actions
$actiontemplates = array();
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
$My_Variable = convert_urlencoded_unicode($My_Variable);
if ($_POST['do'] == 'ajax')
{
echo $_POST['pagevar'];
exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" lang="en">
<head>
<script type="text/javascript" src="clientscript/test.js"></script>
<title>Test</title>
</head>
<body>
What Do I place here??????
I don't understand what I place in the HTML part? Could you
please show some code example. The PHP/Java/HTML.

Thanks