在下面代码中,如何用xpath将"function handlerfunc(){a<b}"取出来呢?
如果不用xpath,还有什么办法可以取呢?急!!!
<html>
<head>
<title></title>
<meta name="Generator" content="Microsoft FrontPage 5.0" /><script src="calander.js"></script>
</head>
<body>
<p></p>
<div id="DIVhandler" style=" width: 16px; height: 16px"><script language="JavaScript">function handlerfunc(){a<b}</script></div>
</body>
</html>
如果不用xpath,还有什么办法可以取呢?急!!!
<html>
<head>
<title></title>
<meta name="Generator" content="Microsoft FrontPage 5.0" /><script src="calander.js"></script>
</head>
<body>
<p></p>
<div id="DIVhandler" style=" width: 16px; height: 16px"><script language="JavaScript">function handlerfunc(){a<b}</script></div>
</body>
</html>
var tabletype=xmlDoc.selectNodes("//div[@id=\"DIVhandler\"]/script/text()");
但是脚本要放到CDATA节点中,这样就没问题了,否则<要写成<,那么脚本会错.