[英]Why this code source in fiddle does not work on my local
Did i miss something here in the html/js page ?我是否错过了 html/js 页面中的某些内容? the code is running good in JSFIDDLE but not in my desk !!!!
代码在 JSFIDDLE 中运行良好,但在我的办公桌上运行良好!!!!
this is the working fiddle : http://jsfiddle.net/WNDQJ/1/result/
这是工作小提琴: http : //jsfiddle.net/WNDQJ/1/result/
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>title</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script>
$(document).ready(function () {
$("#addRow").click(function () {
$("#myTable").append("<tr><td>row</td><td><input type='text'></td></tr>");
});
});
</script>
</head>
<body>
<table id="myTable">
<tr>
<td>row</td>
<td>
<input type='text'>
</td>
</tr>
<tr>
<td>row</td>
<td>
<input type='text'>
</td>
</tr>
</table>
<input type="button" id="addRow" value="add" />
</body>
</html>
any idea please ?有什么想法吗? Thank you in advance.
先感谢您。
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js">
$(document).ready(function () {
$("#addRow").click(function () {
$("#myTable").append("<tr><td>row</td><td><input type='text'></td></tr>");
});
});
</script>
Have you loaded the jQuery library into your webpage prior to using $(document).ready()?在使用 $(document).ready() 之前,您是否已将 jQuery 库加载到您的网页中?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.