【发布时间】:2014-10-07 18:33:16
【问题描述】:
我有以下链接:
<script src="/WebResource.php?d=FViz" type="text/javascript"></script>
<script src="WebResource.php?d=FViz" type="text/javascript"></script>
<img src="/Images/top.png">
<img src="Images/top.png">
<link href="/Skins/style.css" rel="stylesheet" type="text/css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
如果链接没有开始,我如何在链接开头插入属于“script”、“link”和“img”标签的所有“src”和“href”属性“http://example.com/”使用“http://”或“www.”。
所以最终的结果应该是这样的
<script src="http://example.com/WebResource.php?d=FViz" type="text/javascript"></script>
<script src="http://example.com/WebResource.php?d=FViz" type="text/javascript"></script>
<img src="http://example.com/Images/top.png">
<img src="http://example.com/Images/top.png">
<link href="http://example.com/Skins/style.css" rel="stylesheet" type="text/css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
我必须强调,它必须在页面加载后在用户浏览器中使用 jQuery 完成,而不是在服务器端。
抱歉,我没有任何基本示例。
【问题讨论】:
标签: jquery