我想在HTML页面中直接将缩小的java脚本内容放在标签中。 我有html页面像:
<html> <head> <script src="jquery.js"></script> <script src="iemagic.js"></script> <script src="shim.js"></script> <script src="jszip.js"></script> <script src="xlsx.js"></script> </head> </html>我已经缩小了所有的javascript内容并将其放在一个名为“all.js”的文件中,并且html工作正常,现在它看起来像:
<html> <head> <script src="all.js"></script> </head> </html>我想直接在“script”标签中将“all.js”的所有内容包含在HTML中。 我尝试了但没有运气,当我在浏览器中打开html文件时,它显示了我在“script”标签中复制的所有java脚本内容。
还有其他办法吗?
I want to put a minified java script contents in tags directly in HTML page. i have html page like:
<html> <head> <script src="jquery.js"></script> <script src="iemagic.js"></script> <script src="shim.js"></script> <script src="jszip.js"></script> <script src="xlsx.js"></script> </head> </html>I have minified all the javascript contents and put it in a single file called "all.js" and the html works fine, now it looks like :
<html> <head> <script src="all.js"></script> </head> </html>I want to include all the content of "all.js" in to HTML directly in "script" tag. I tried with that but no luck, when i open html file in browser it show all the java script content which i have copied in "script" tag.
Is there any other way for this ?
最满意答案
谢谢大家的帮助。 我找到了解决方案。 *添加了所有“js”文件在不同的“脚本”标签测试工作正常,但一些javascript线在浏览器中可见。 *问题是“iemagic.js”有不正确的评论并且正在创建问题。 *我删除了这些注释行,现在正在查找。 没有任何“js”文件和只有一个HTML。 谢谢大家的帮助和宝贵的时间。
Thank you all for helping me. i have found the solution for this. * added all the "js" files in different "script" tag tested working fine but some of the javascript lines was visible in the browswer. * The problem was "iemagic.js" was having the comments which are not proper and was creating the problem. * I have removed those commented lines and is working find now. without having any "js" file and only one HTML. Thank you All for your help and valuable time.
更多推荐
发布评论