我们正在开发一个服务器移动应用程序,目前还没有服务器端的实现。
我想在Javascript MButton1JSClick事件上使用我自己的函数,如以下代码所示:
问题是,我应该把myFunction()的实际函数代码放在哪里?
<?php
require_once("rpcl/rpcl.inc.php");
//Includes
use_unit("jquerymobile/forms.inc.php");
use_unit("extctrls.inc.php");
use_unit("stdctrls.inc.php");
use_unit("jquerymobile/jmobile.inc.php");
//Class definition
class MPage1 extends MPage
{
public $MButton1 = null;
function MButton1JSClick($sender, $params)
{
?>
//begin js
myFunction();
//end
<?php
}
}
global $application;
global $MPage1;
//Creates the form
$MPage1=new MPage1($application);
//Read from resource file
$MPage1->loadResource(__FILE__);
//Shows the form
$MPage1->show();
?>任何帮助都将不胜感激,谢谢。
发布于 2013-05-15 21:34:12
您可以在单独的客户端单元(JavaScript文件)中定义JavaScript函数。
文档:。
https://stackoverflow.com/questions/16566219
复制相似问题