解决方案 »
- 通过Ajax 请求刷新的页面元素如何添加事件?
- 请教一个js正则表达式
- style="overflow: hidden; text-overflow: ellipsis;" 怎么不起作用?详细代码见内。
- 关于js引用js的问题,高手进
- 我用window.showModalDialog打开一个子窗口,为什么在提交的时候,会出现一个要求刷新的页面...
- 如何实现在一个网页装载后初始化网页表单中下拉选框的值?
- 着急!!!请问哪里有可以用鼠标动态调整层的大小的例子?
- 向两个页面赋值的问题?
- json数据的装换
- checkbox有2个全选按钮,如何选择其中一个,另一个也自动选上,反之亦然
- js用document.getElementById获取的值显示为[object HTMLInputElement]
- JS 在不同系统下的IE11上 运行结果为什么会不一样?有时候还没效果?
$("#testbutton")上面还小了个<script>
<script>
$(document).ready(function(){
//
$("#testbutton").click(
function(){
$("#second").append("<b>Just a test.</b>");
}
);
});
</script>
<script type="text/JavaScript">
$(document).ready(function () {
//
$("#testbutton").click(
function () {
$("#second").append("<b>Just a test.</b>");
}
);
});
</script>
包含引入js的如下:
这样在firebug中会提示ReferenceError: $ is not defined,我怀疑是不是中文输入时的全角问题,不过我用英文输入法重写了一次,还是这样。<script type="text/javascript" src="jquery.js"></script>
<script type="text/JavaScript" >
$(document).ready(function(){
//
$("#testbutton").click(
function(){
$("#second").append("<b>Just a test.</b>");
}
);
});
</script>去掉引入的如下: <script type="text/JavaScript" >
$(document).ready(function(){
//
$("#testbutton").click(
function(){
$("#second").append("<b>Just a test.</b>");
}
);
});
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312" />
<title>jQuery Playground</title>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/JavaScript">
$(document).ready(function () {
//
$("#testbutton").click(
function () {
$("#second").append("<b>Just a test.</b>");
}
);
});
</script>
<style type="text/css">
#second{
color: white;
background-color: green;
}
.indianred{
background-color: #CD5C5C;
}
</style>
</head>
<body>
<div id="wrapper">
<h1>jQuery Playground</h1>
<ul id= "nav">
<li><a class="current" href="index.html">测试页面</a></li>
<li><a href="#">关于</a></li>
</ul>
</div>
<div id="content">
<button id="testbutton">test</button>
<br/><br/>
<div id="first">
this a word for test, before run location is home of test text.
</div>
<div id="second">
UT bibendum nulla eget ligula. Pellenttesque rhoncus pellentesque ipsum.
</div>
<div id="third">
this is a word for test, before run location is end of test text.
</div>
</div>
<div id="foot">Powered By Jerry.</div>
</body>