【发布时间】:2011-05-07 18:21:59
【问题描述】:
我想在我的 test.html 中动态添加一个外部 JavaScript 或 CSS 文件。 我知道这个技巧:
$(”).appendTo(‘head’).attr({
rel: ‘stylesheet’,
type: ‘text/css’,
href: ‘**htttp://192.168.30.229:8080/**javascripts/jwysiwyg/jquery.wysiwyg.css’
});
我想将 css 和 javascript 的 url(http://192.168.30.229:8080/) 保存在 xml 文件(例如 web.xml)中,并从 web.xml 文件中读取 url并将其附加到 href 因此如果 URL 必须更改,例如 **:http://192.168.100.229:7071/ html中的代码无需更改。
我应该如何在 xml 文件中写入/读取该 url 并在 test.html 中使用它?
【问题讨论】:
标签: java javascript jquery css