⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scriptcalltest.php

📁 php绿色服务器,让大家试用greenamp
💻 PHP
字号:
<?phprequire("../xajax.inc.php");function callScript(){	$response = new xajaxResponse();	$value2 = "this is a string";	$response->addScriptCall("myJSFunction", "arg1", 9432.12, array("myKey" => "some value", "key2" => $value2));	return $response;}$xajax = new xajax();//$xajax->debugOn();$xajax->registerFunction("callScript");$xajax->processRequests();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>	<title>addScriptCall Test | xajax Tests</title>	<?php $xajax->printJavascript("../") ?>	<script type="text/javascript">function myJSFunction(firstArg, numberArg, myArrayArg){    var newString = firstArg + " and " + (+numberArg + 100) + "\n";    newString += myArrayArg["myKey"] + " | " + myArrayArg.key2;    alert(newString);    xajax.$('myDiv').innerHTML = newString;}	</script></head><body><h2><a href="index.php">xajax Tests</a></h2><h1>addScriptCall Test</h1><p>Howdy. <input type="button" value="Click Me" onclick="xajax_callScript()" /></p><p>Result:</p><pre id="myDiv">[blank]</pre><p>Expecting:</p><pre>arg1 and 9532.12some value | this is a string</pre></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -