首页 > 解决方案 > 在断点期间更改脚本元素的 src 属性

问题描述

我有以下html代码:

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="http://localhost:8086/a/b/myLib.js"></script>
</head>
<body>

</body>
<script>
    myLib.displayAlert("Yoog");
</script>
</html>

我在调用函数之前添加了一个断点,myLib.displayAlert并且我想将src脚本从以下位置更改为另一个srchttp://localhost:8086/a/b/c/myLib.js

有没有办法动态改变src脚本,这样当我继续程序时,我会得到一个不同的实现myLib.displayAlert

标签: javascripthtml

解决方案


推荐阅读