假设html代码如下,需要替换<script里的src链接
就是把aa/bb/code.js?tenkey替换成cc/dd/code.js?tenkey
src里只有code.js?是固定类型
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> 问 题</title>
</head>
<body>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<script src="aa/bb/code.js?tenkey" type="text/javascript"></script>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</body>
</html>