All pastes #790162 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-11-20 03:32 UTC
rendered paste body
<?php
require_once("lib/db.php");
require_once("inc/message.php");
require_once("inc/header.php");
require_once("libx/xajax.inc.php");

function hede()
{
    // do some stuff based on $arg like query data from a database and
    // put it into a variable like $newContent
    
    // Instantiate the xajaxResponse object
    $objResponse = new xajaxResponse();
    
    $newContent = "asdaasdsas";
    // add a command to the response to assign the innerHTML attribute of
    // the element with id="SomeElementId" to whatever the new content is
    $objResponse->addAssign("hehe","innerHTML", $newContent);
    
    //return the  xajaxResponse object
return $objResponse->getXML();
}

$xajax = new xajax();
$xajax->registerFunction("hede");
$xajax->processRequests();
$xajax->printJavascript();
?>

<div id="hehe"  style="border:1px red solid;height:100px;"></div>

<input type="button" value="Insert" onclick="xajax_hede();" />