且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将javascript放在html5的外部文件中

更新时间:2023-09-22 08:02:04

您只需使用代码$创建一个外部JS文件b $ b并包含如下:

You simply create an external JS file with your code and include it like this:

< script src =myFile.js> < / script>

<script src="<myFile>.js" type="text/javascript"></script>

确保将JS文件放在您拥有HTML文件的目录中

Be sure to place the JS file in the directory where you have your HTML file

评论后:我猜你必须用javacript动态创建一个图像,设置它的 src porpertie和它的显示。

After comment: I guess you have to dynamically create an image with javacript set it's src porpertie and the diplay it.