Skip to content
Advertisement

How can I initiate Ajax request from firefox developer tools?

I want to test several Ajax requests after the backend code completed. Now my method is adding a dummy button, an onclick event and an ajax request inside that.

Is there any way I can initiate Ajax request for testing from without editing my jsp / frontend?

Advertisement

Answer

You can use Scratchpad, Firefox’s dedicated tool for executing 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.

Just open up Firefox and hit Shift+F4 and you are good to go. using Ctrl+R you can run your code (whole code or selected parts)

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.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement