开发者

javascript file talk to script in html file

Is there a way of calling a function that exists in a HTML file from a .js file?

Something like this:

HTML file:

<script type="text/javascript" src="javaFile.js"></script>
<script 开发者_如何转开发type="text/javascript">
    function doSomething() {
    };
</script>

javaFile.JS file:

htmlFile.doSomething();

? Thanks :)


You can directly call doSomething();

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜