找到
3
篇与
js
相关的结果
-
法制考试常用脚本 1. 过无限debugger Function.prototype.__constructor_back = Function.prototype.constructor; Function.prototype.constructor = function() { if(arguments && typeof arguments[0]==='string'){ if("debugger" === arguments[0]){ return } } return Function.prototype.__constructor_back.apply(this,arguments); }2.自动答题 隐藏内容,请前往内页查看详情 3. 自动播放视频 const video_player = document.querySelector('#myVideo_html5_api') video_player.play() // 静音 video_player.volume = 0 // 16倍数 video_player.playbackRate = 1 -
前端jsonp转换json格式 以百度搜索建议为例 后端返回数据样式 ({ q: "没有的", p: false, s: ["没有的英语单词", "没有的读音", "没有的近义词", "没有的事总是能胡思乱想出一些事"] });使用js处理 const response = await axios.get( `https://www.baidu.com/su?wd=${encodeURIComponent(query)}&cb=hello`, ); // 提取JSON部分 const apiResponse = response.data.match(/hello\(([^)]+)\)/)[1]; const data = JSON.parse(apiResponse.replace(/(\w+)(?=:)/g, '"$1"'));