Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/385.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
Jsoup将我的javascript字符串转换为一行_Java_Javascript_Android_Jsoup - Fatal编程技术网

Jsoup将我的javascript字符串转换为一行

Jsoup将我的javascript字符串转换为一行,java,javascript,android,jsoup,Java,Javascript,Android,Jsoup,我在Jsoup中使用.append函数时遇到问题。我将简单的Javascript文件响应字符串附加到Jsoup元素。但是在附加了我的回应之后,我的反应变成了一行,这让我很痛苦 我的绳子是这样的 (function () { var count = 0; var root = this; var require = root.require; //var require = cordova.require; require.config({ config: { text

我在Jsoup中使用.append函数时遇到问题。我将简单的Javascript文件响应字符串附加到Jsoup元素。但是在附加了我的回应之后,我的反应变成了一行,这让我很痛苦

我的绳子是这样的

(function () {

var count = 0;
var root = this;
var require = root.require;
//var require = cordova.require;
require.config({

    config: {
        text: { //this hacks the text api to allow cross domain loading of the templates. it is needed only for the packaged applications
            useXhr: function (url, protocol, hostname, port) {
                //console.log("text.useXhr request came from : " + url + ", " + protocol + " and " + hostname);
                return true;
                //return true if you want to allow this url, given that the 
                //text plugin thinks the request is coming from protocol, hostname, port. 
            }
        },
        'is': {
            isBundled: true
        }
    },
    waitSeconds: 45,
    baseUrl: 'scripts/app',
    deps: ["app"],
但在附加到元素之后,它将成为

(function () { var count = 0; var root = this; var require = root.require; //var require = cordova.require; require.config({ config: { text: { //this hacks the text api to allow cross domain loading of the templates. it is needed only for the packaged applications useXhr: function (url, protocol, hostname, port) { //console.log("text.useXhr request came from : " + 
我的代码就是这个

String temp=script.attr("src");
                    temp=temp.replace("/"+Heirarchy, DomainName+"/"+Heirarchy.toLowerCase());
                    script.attr("src", temp);
                    script.removeAttr("data-main");
                    script.removeAttr("async");
                    String innerHtml="</script>\n<script>\n"+old_configString;
                    script.append(innerHtml);
String temp=script.attr(“src”);
temp=temp.replace(“/”+继承权,域名+“/”+继承权.toLowerCase());
script.attr(“src”,temp);
script.removeAttr(“数据主”);
script.removeAttr(“异步”);
字符串innerHtml=“\n\n”+旧的\u配置字符串;
append(innerHtml);
old_configString是我的Javascript响应字符串…

您应该使用来添加脚本或样式

script.after(new DataNode("<script>" + old_configString + "</script>", "http://domain.tld/path"));
script.after(新数据节点(“+old_configString+”,”http://domain.tld/path"));
您应该使用用于添加脚本或样式的

script.after(new DataNode("<script>" + old_configString + "</script>", "http://domain.tld/path"));
script.after(新数据节点(“+old_configString+”,”http://domain.tld/path"));
您应该使用用于添加脚本或样式的

script.after(new DataNode("<script>" + old_configString + "</script>", "http://domain.tld/path"));
script.after(新数据节点(“+old_configString+”,”http://domain.tld/path"));
您应该使用用于添加脚本或样式的

script.after(new DataNode("<script>" + old_configString + "</script>", "http://domain.tld/path"));
script.after(新数据节点(“+old_configString+”,”http://domain.tld/path"));

谢谢你让我开心谢谢你让我开心谢谢你让我开心谢谢你让我开心