javascript - 在断点期间更改脚本元素的 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
脚本从以下位置更改为另一个src
:http://localhost:8086/a/b/c/myLib.js。
有没有办法动态改变src
脚本,这样当我继续程序时,我会得到一个不同的实现myLib.displayAlert
?
解决方案
推荐阅读
- python - 检查对象是否在集合中(Python)
- javascript - html界面在第一次使用后就消失了,并抛出了一些错误
- php - skaffold 为某些文件重建图像,而不为其他文件重建图像
- java - 由于 setText 方法,AndroidStudio VM 关闭 myapp
- visual-studio-code - pyglet.canvas.xlib.NoSuchDisplayException:无法连接到“无”仅发生在 VSCode 终端中
- python - int() 参数必须是字符串或数字,而不是 'NoneType'
- linux - 如何使用shell从txt中读取一些数据
- c++ - 如果 arr 是一个数组,C++ 中的 *&arr 和 *&arr[0] 有什么区别?
- r - 需要帮助修改 R 中的森林图代码
- reactjs - 从 React 向 Spring REST 发送授权请求