js下将字符串当函数执行的方法
时间:2024-06-15 23:01:25
//测试函数
function test(str){
alert(str);
}
// 方法一
window["test"]("方法一");
// 方法二
eval('test("方法二")');
标签:字符串,函数执行
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
PHP自动生成缩略图函数的源码示例
2023-06-26 19:13:37
Python基于二分查找实现求整数平方根的方法
2023-01-17 01:33:49
Python解析JSON数据的基本方法实例代码
2021-02-13 20:40:01
通过SQL Server的位运算功能巧妙解决多选查询方法
2024-01-22 01:21:26
PHP PDOStatement::bindValue讲解
2023-06-14 11:16:02
浅述七大主流数据库
2011-08-05 18:21:27
Python 安装setuptools和pip工具操作方法(必看)
2023-11-06 11:46:07
![](https://img.aspxhome.com/file/2023/1/65091_0s.png)
Python实现将DNA序列存储为tfr文件并读取流程介绍
2021-08-04 08:02:23
![](https://img.aspxhome.com/file/2023/0/133700_0s.png)
Python中使用matplotlib模块errorbar函数绘制误差棒图实例代码
2022-11-09 17:01:42
![](https://img.aspxhome.com/file/2023/5/79435_0s.png)
详解PHP的Sodium加密扩展函数
2024-03-17 23:53:02
python实现npy格式文件转换为txt文件操作
2021-04-03 08:07:05
![](https://img.aspxhome.com/file/2023/5/92075_0s.jpg)
php异步:在php中使用fsockopen curl实现类似异步处理的功能方法
2023-07-21 14:48:58
Python 异常处理实例详解
2021-10-14 05:36:39
用python写个颜值评分器筛选最美主播
2022-11-25 22:13:08
![](https://img.aspxhome.com/file/2023/1/80731_0s.png)
layer页面跳转,获取html子节点元素的值方法
2024-04-29 13:43:15
Git操作规范之tag的使用技巧详解
2022-07-30 05:10:54
Python argparse库的基本使用步骤
2023-12-14 08:02:29
基于numpy中数组元素的切片复制方法
2023-07-24 03:14:41
如何使用Docker恢复Mysql8备份的Data数据
2024-01-14 20:07:04
![](https://img.aspxhome.com/file/2023/7/127957_0s.jpg)
一文搞懂MySQL XA如何实现分布式事务
2024-01-22 23:25:19
![](https://img.aspxhome.com/file/2023/8/121238_0s.png)