Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/287.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在离线html5应用程序中使用php_Php_Android_Html_Cordova_Phonegap Plugins - Fatal编程技术网

在离线html5应用程序中使用php

在离线html5应用程序中使用php,php,android,html,cordova,phonegap-plugins,Php,Android,Html,Cordova,Phonegap Plugins,我有一个离线的HTML5应用程序,我用cordova移植到android上。现在该应用程序有一些链接到它的php脚本,可以将动态内容从我的web服务器拉到html5 android应用程序 PHP代码示例包括在index.html <div class="blog-post"> <div class="wrapper"> <?php includ

我有一个离线的HTML5应用程序,我用cordova移植到android上。现在该应用程序有一些链接到它的php脚本,可以将动态内容从我的web服务器拉到html5 android应用程序

PHP代码示例包括在
index.html

                 <div class="blog-post">
                    <div class="wrapper">
                        <?php include 'includes/news_index.php';?>

                    </div> <!-- .blog-meta --> 
                 </div> <!-- .blog-post--> 

news\u index.php
存储在我的在线web服务器中。如何指向url,以便应用程序能够将内容从服务器拉到我的应用程序?

@nick,
从PHP脚本的内容中删除任何不需要的HTML元素。使用JQuery进行调用,并使用JQuery插入。它看起来是这样的:

HTML

Javascript
$.get(“http://server/includes/news_index.php,函数(数据){
$(“#content”).html(数据);
});

以下是参考资料:

一种流行的轻质替代品是

FWIW,您想删除任何不需要的HTML,因为新的HTML引擎不能原谅这一点


祝你好运。

我认为你应该调用android函数从web加载内容,并通过js添加到你的应用程序中,或者使用PhoneGap查看Cordova。我对它们略知一二,但我想这可能会有所帮助。我只是想验证一下(以我的观点):通过使用
$.get()
,即使在脱机状态下,
news\u index.php
中的数据也会被返回?