如何将我的脚本放在extern文件中? [英] How do i put my script in an extern file?

查看:66
本文介绍了如何将我的脚本放在extern文件中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在HTML-doc的正文中放置了一个脚本。

我注意到我将使用大量相同的脚本

文档(所有这些都是脚本关于给定文件的最新版本的时间)。


我可以将脚本放入每一个文件但是:

1.我太懒了,无法通过100个文件做一个和

相同的事情。那是猴子,而不是懒人。

2.即使我不是那么懒,我也不得不重新编辑每一个

文件一次我对剧本做了一些小改动。这是为了给b
疯狂的猴子!


那么,我如何将脚本放在一个文件中我如何调用
$来自我的HTML代码的b $ b文件?


-


亲切的

Konrad

---------------------------------------------- -----

愿所有垃圾邮件发送者死于痛苦的死亡;没有埋葬地点;

他们的灵魂会被Gehenna的恶魔从一个房间追逐到

另一个永恒和更多。


睡眠 - 无效人士使用的东西

作为咖啡的替代品


野心 - 一个糟糕的借口没有

足够的感觉是懒惰的

------------------------------------- --------------

I have a script placed somewhere in the body of my HTML-doc.
I noticed that i''ll be using the very same script in a large number
of document (all of them as the script regards the time of the
most recent edition of the given file).

I could place the script in every single document BUT:
1. I''m far too lazy to go through 100 documents doing one and the
same thing. That''s for monkeys, not lazy humans.
2. Even if i wasn''t so lazy, i''d have to reedit every single
document once i made a small change to the script. That''s for
crazy monkeys!

So, how can i place the script in a file and how do i call the
file from my HTML-code?

--

Kindly
Konrad
---------------------------------------------------
May all spammers die an agonizing death; have no burial places;
their souls be chased by demons in Gehenna from one room to
another for all eternity and more.

Sleep - thing used by ineffective people
as a substitute for coffee

Ambition - a poor excuse for not having
enough sense to be lazy
---------------------------------------------------


推荐答案

这很容易。在你输入的HTML文件中:

< script language =" JavaScript" src =" yourscriptfile.js">< / script>

您将脚本文件放在yourscriptfile.js中

JW
It''s easy. In the HTML-file you put :
<script language="JavaScript" src="yourscriptfile.js"></script>

And you place your scriptfile in the "yourscriptfile.js"
JW


只需加上


< script language =" javascript" < head>之间的src =" nameofyourscript.js">< / script>


标签......


该页面将自动读取,就好像它在

页面本身一样......


问候
Just put

<script language="javascript" src="nameofyourscript.js"></script>

between the <head> tags...

The page will automatically read it as if it was in the
page itself...

Greetings


谢谢,今晚会试试。


-


亲切

康拉德

------------------------------ ---------------------

愿所有垃圾邮件发送者死于痛苦的死亡;没有埋葬地点;

他们的灵魂会被Gehenna的恶魔从一个房间追逐到

另一个永恒和更多。


睡眠 - 无效人士使用的东西

作为咖啡的替代品


野心 - 一个糟糕的借口没有

足够的感觉是懒惰的

------------------------------------- --------------


Thanks, Will try that tonight.

--

Kindly
Konrad
---------------------------------------------------
May all spammers die an agonizing death; have no burial places;
their souls be chased by demons in Gehenna from one room to
another for all eternity and more.

Sleep - thing used by ineffective people
as a substitute for coffee

Ambition - a poor excuse for not having
enough sense to be lazy
---------------------------------------------------



这篇关于如何将我的脚本放在extern文件中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆