[英]How can I initiate Ajax request from firefox developer tools?
I want to test several Ajax requests after the backend code completed.我想在后端代码完成后测试几个 Ajax 请求。 Now my method is adding a dummy button, an onclick event and an ajax request inside that.现在我的方法是在其中添加一个虚拟按钮、一个 onclick 事件和一个 ajax 请求。
Is there any way I can initiate Ajax request for testing from firefox-developer-tools without editing my jsp / frontend?有什么方法可以在不编辑我的 jsp/前端的情况下从firefox-developer-tools启动 Ajax 请求进行测试?
You can use Scratchpad , Firefox's dedicated tool for executing JavaScript.您可以使用 Firefox 的专用工具Scratchpad来执行 JavaScript。
From docs:从文档:
Unlike the Web Console, which is designed for interpreting a single line of code at a time, Scratchpad lets you edit larger chunks of JavaScript code, then execute it in various ways depending on how you want to use the output.与专为一次解释一行代码而设计的 Web 控制台不同,Scratchpad 允许您编辑更大的 JavaScript 代码块,然后根据您希望如何使用输出以各种方式执行它。
Just open up Firefox and hit Shift+F4
and you are good to go.只需打开 Firefox 并按Shift+F4
即可。 using Ctrl+R
you can run your code ( whole code or selected parts )使用Ctrl+R
您可以运行您的代码(整个代码或选定的部分)
BTW you can have Scratchpad as a tab in dev tools , of course it's not enabled by default, but you can enable that via dev tool options.顺便说一句,您可以将 Scratchpad 作为开发工具中的选项卡,当然默认情况下它不会启用,但您可以通过开发工具选项启用它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.