【发布时间】:2012-11-01 16:00:00
【问题描述】:
我是唯一一个对此有问题的人吗?我现在还没有确切的代码,但它类似于以下内容...(这是我用来启动和运行 TideSDK 的最简单的示例)
我的 index.html 中有...
<script>
Titanium.include("testLibrary.php")
</script>
<script>
var testresult = new testMethod();
document.write(testresult);
</script>
而我的资源目录中的 testLibrary.php 文件很简单...
<?php
function testMethod()
{
$fixedResult = "The most basic php variable for display in the DOM";
return $fixedResult;
}
我为打包等打开了 php。当我在索引文件中包含 php 代码时一切正常,所以我知道 php 正在工作,我只是无法让 include 工作??
【问题讨论】:
-
你为什么在方法上调用 new ?试试 var testresult = testMethod();
-
另外,你不需要