Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/369.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/195.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
Javascript 外包jQuery移动内容_Javascript_Android_Jquery_Jquery Mobile_Cordova - Fatal编程技术网

Javascript 外包jQuery移动内容

Javascript 外包jQuery移动内容,javascript,android,jquery,jquery-mobile,cordova,Javascript,Android,Jquery,Jquery Mobile,Cordova,目前,我正在为Android开发一个JQuery Mobile PhoneGap应用程序,它有多页模板,只有一个html页面 有意义吗,像一个印记一样外包广泛的内容?这样index.html就更小了 如果有道理,那么最好的方法是什么? 我想外包一些带有html标记的文本,如: <p><b>Li Europan lingues es membres del sam familie.<br /> Li lingues differe solmen in li g

目前,我正在为Android开发一个JQuery Mobile PhoneGap应用程序,它有多页模板,只有一个html页面

有意义吗,像一个印记一样外包广泛的内容?这样index.html就更小了

如果有道理,那么最好的方法是什么? 我想外包一些带有html标记的文本,如:

<p><b>Li Europan lingues es membres del sam familie.<br />

Li lingues differe solmen in li grammatica,<br />
li pronunciation e li plu commun vocabules. <br />

213214532532432143434<br />
676435432543543<br />

refusa: <a href="mailto:quande@quande.com">desirabilite de un nov </a><br />
pronunciation: <a href="http://www.quande.com" target="_blank">quande</a> <br /></p>
我试过了

jQuery.get('test.txt', function(data) {
    $('#imprint_content').html(data.replace('\n','<br>'));
});
但我得到了这个错误:

选择权file:///D:/xxx/assets/www/test.txt 不 “Access Control Allow Origin”标头出现在请求的服务器上 资源因此,不允许访问源“null”。 jquery-1.10.2.min.js:6

无法加载XMLHttpRequestfile:///D:/xxx/assets/www/test.txt. 请求的服务器上不存在“Access Control Allow Origin”标头 资源因此,不允许访问源“null”。index.html:1

编辑:如果我在服务器上上传test.txt。我得到这个错误:

无法加载XMLHttpRequest。不 “Access Control Allow Origin”标头出现在请求的服务器上 资源因此,不允许访问源“null”


Downvote没有评论,为什么?关于远程服务器的访问源错误,在config.xml中为应用程序中的文件配置访问源不应该是必需的,除非您至少没有127.0.0.1*以前的评论是关于在phonegap应用程序中运行。看日志file:///D:/xxx/assets/www/test.txt,似乎您正在从计算机浏览器打开页面。这就是你在做的吗?