我得到错误:SyntaxError: Unexpected token ILLEGAL [http://localhost/test/drop:13]
我的页面代码操作系统:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="mini.js"></script>
<script language="javascript">
$(document).ready(function() {
$("#main_div").empty();
$("#drp_name option").each(function() {
$("#main_div").append("<div>"+ $(this).text() +"</div>")
});
});
</script>
</head>
<body>
<select name="drp_name" id="drp_name">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
<div id="main_div"></div>
</body>
</html>
我用jQueryv1.7.2