为什么这个简单的JSFiddle不起作用? [英] Why does this simple JSFiddle not work?
本文介绍了为什么这个简单的JSFiddle不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$ b
function displaymessage(){
alert(Hello World!);
<形式>
< input type =buttonvalue =点击我! onclick =displaymessage()/>
< / form>
< p>通过按下上面的按钮,将会调用一个函数。该功能会提示消息。< / p>
解决方案
http://jsfiddle.net/praveen_prasad/XNJxT/14/
Js对任何你写的东西都是这样的东西
window.addEvent('load',function(){
//您的代码
});
There is some code I wanted to put into JSFiddle. It didn’t work. Narrowing it down I can’t even get this simplest of code to work:
function displaymessage() {
alert("Hello World!");
}
<form>
<input type="button" value="Click me!" onclick="displaymessage()" />
</form>
<p>By pressing the button above, a function will be called. The function will alert a message.</p>
The alert
box doesn’t show up in the JSFiddle.
解决方案
http://jsfiddle.net/praveen_prasad/XNJxT/14/
Js fiddle so something like this to whatever you write
window.addEvent('load',function(){
//Your code
});
这篇关于为什么这个简单的JSFiddle不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文