[英]Is there a way to use javascript code without using <script> tag?
So I'm working on my online portfolio using prosite.com and I created some simple hover thingy using javascript ( http://wojtek.szukszto.com/index.html ). 所以我正在使用prosite.com开发我的在线投资组合,并使用javascript( http://wojtek.szukszto.com/index.html )创建了一些简单的悬停东西。 The problem is prosite.com won't allow me to use < script > tag... Is there any way to do it? 问题是prosite.com不允许我使用<script>标签......有什么办法吗? Maybe as an external html? 也许作为外部HTML? I don't know... I'm not really good in coding, so any help would be appreciated. 我不知道......我的编码不是很好,所以任何帮助都会受到赞赏。
You can have them as DOM Events like 您可以将它们作为DOM事件
<div onclick="alert('cat');">
I <strong>Really</strong> want a cat!
</div>
<body onload="//you can put a whole bunch of stuff here"></body>
(It is equivalent to window.onload = function(){ //stuff })
You can put your javascript code into external file and call in the head section of your html document 您可以将您的javascript代码放入外部文件,并在html文档的head部分调用
<head>
<script src ="/JS/yourjsfile.js"></script>
</head>
hope that your host allows you to call JS in the head section 希望你的主机允许你在head部分调用JS
The way I do it is by stating the type of script. 我这样做的方法是说明脚本的类型。 The ProSite already has javascript integrated within itself. ProSite已经集成了javascript。 I use: 我用:
<script type="javascript"> Code-Goes-Here </script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.