Jquery Phpstorm



PHPUnit tests can be developed in PhpStorm and run instantly from a directory, file or class using the context menu options) with code coverage. JavaScript, CSS and HTML features. Code completion for JavaScript, HTML and CSS (for tags, keywords, labels, variables, parameters and functions). Best HTML & JavaScript support included. JetBrains has a passion for making developers more productive. We design intelligent development tools to simplify your challenging tasks, automate the easy ones, and help you develop with pleasure. Starting with version 7, PhpStorm bundles the Drupal Plugin providing many Drupal-specific features, such as.

PhpStorm provides a built-in debugger for your client-side JavaScript code that works with Chrome. The video and the instructions below walk you through the basic steps to get started with this debugger.

Jquery Phpstorm

To learn how to debug PHP and JavaScript code simultaneously from within PhpStorm, see Debug PHP and JavaScript code at the same time.

Before you start

  • Make sure the JavaScript Debugger bundled plugin is enabled on the Settings/Preferences | Plugins page, see Managing plugins for details.

Debugging an application running on the built-in server

PhpStorm has a built-in web server that can be used to preview and debug your application. This server is always running and does not require any manual configuration. All the project files are served on the built-in server with the root URL http://localhost:<built-in server port>/<project root>, with respect to the project structure.

Start debugging

  1. Set the breakpoints in the JavaScript code, as required.

  2. Open the HTML file that references the JavaScript to debug or select the HTML file in the Project tool window.

  3. From the context menu of the editor or the selection, choose Debug <HTML_file_name>. PhpStorm generates a debug configuration and starts a debugging session through it. The file opens in the browser, and the Debug tool window appears.

    To save the automatically generated configuration for further re-use, choose Save <HTML_file_name> from the context menu after the debugging session is over.

  4. In the Debug tool window, proceed as usual: step through the program, pause and resume the program execution, examine it when suspended, view actual HTML DOM, run JavaScript code snippets in the Console, and so on..

By default, a debugging session starts in a new window with a custom Chrome user data. To open a new Chrome instance with your familiar look-and-feel, configure Chrome in PhpStorm to start with your user data, see Starting a debugging session with your default Chrome user data for details.

Example

Suppose you have a simple application that consists of an index.html file and an index.js file, where index.html references index.js. To start debugging this application using the built-in server, open index.html in the editor and choose Debug 'index.html' from the context menu:

PhpStorm creates a run/debug configuration automatically, and a debugging session starts:

To restart the new run/debug configuration, click in the upper right-hand corner of the PhpStorm window or choose Run | Debug from the main menu:

Debugging an application running on an external web server

Phpstorm jquery snippets

Jet Brains Js Ide

Often you may want to debug client-side JavaScript running on an external development web server, for example powered by Node.js.

Start debugging

  1. Set the breakpoints in the JavaScript code, as required.

  2. Run the application in the development mode. Often you need to run npm start for that.

    When the development server is ready, copy the URL address at which the application is running in the browser - you will need to specify this URL address in the run/debug configuration.

  3. Create a debug configuration of the type JavaScript Debug: from the main menu, select Run | Edit Configuration, click on the toolbar and select JavaScript Debug from the list. In the Run/Debug Configuration: JavaScript Debug dialog that opens, specify the URL address at which the application is running. This URL can be copied from the address bar of your browser as described in Step 2 above. Click OK to save the configuration settings.

  4. Select the newly created configuration from the Select run/debug configuration list on the toolbar and click next to the list. The URL address specified in the run configuration opens in the browser and the Debug tool window appears.

  5. In the Debug tool window, proceed as usual: step through the program, pause and resume the program execution, examine it when suspended, view actual HTML DOM, run JavaScript code snippets in the Console, and so on..

See Debugging React Applications and Debugging Angular Applications for examples.

Debugging asynchronous code

PhpStorm supports debugging asynchronous client-side JavaScript code. PhpStorm recognizes breakpoints inside asynchronous code, stops at them, and lets you step into such code. As soon as a breakpoint inside an asynchronous function is hit or you step into asynchronous code, a new element Async call from <caller> is added in the Frames pane of the Debugger tab. PhpStorm displays a full call stack, including the caller and the entire way to the beginning of the asynchronous actions.

The image below shows an example of a JavaScript debugging session. The debugger stops at line3(breakpoint), then at line5(breakpoint). On clicking Step into, the debugger will stop at line5 (on function ), then will move to line6.

The asynchronous debugging mode is turned on by default. To disable asynchronous stack traces, set js.debugger.async.call.stack.depth in Registry to 0.

Debugging workers

PhpStorm supports debugging Service Workers and Web Workers. PhpStorm recognizes breakpoints in each worker and shows the debug data for it as a separate thread in the Frames pane on the Debugger tab of the Debug tool window.

Note that PhpStorm can debug only dedicated workers, debugging for shared workers is currently not supported.

  1. Set the breakpoints in the Workers to debug.

  2. If you are using Service Workers, make sure the Allow unsigned requests checkbox on the Debugger page is selected. Otherwise your service workers may be unavailable during a debug session:

  3. Create a debug configuration of the type JavaScript Debug as described above in Debugging client-side JavaScript running on an external web server.

  4. Select the newly created configuration from the Select run/debug configuration list on the toolbar and click Debug .

    The HTML file specified in the run configuration opens in the chosen browser and the Debug tool window opens with the Frames list showing all the Workers:

    To examine the data (variables, watches, and so on) for a Worker, select its thread in the list and view its data in the Variables and Watches panes. When you select another Worker, the contents of the panes are updated accordingly.

FeaturesPhpStormWebStorm

Hi JavaScript devs!

There’s no doubt that everyone is using one or another library to access/manipulate the DOM, and jQuery is currently the most popular one. And WebStorm has lots of small but really neat features to help you coding. Let’s quickly get a feeling of what we have.

1. Selecting DOM elements

The first thing you usually do is selecting some DOM element(s), right? WebStorm will help you with completion for the most used selector types, such as elements ID-s:

or CSS classes:

Sure you can use more complex selectors, which are also supported, like mixed matching:

or parent-child selectors.

Or you can switch to “chained calls” style – no problem!

Since most of jQuery selectors follow CSS selectors syntax, WebStorm will support you writing any valid CSS fragment, providing live code checking and completion.

Side note: if you’re using Dojo toolkit or prototype.js library you will get the same functionality for selecting DOM elements.

2. Element manipulation

Phpstorm Jquery Autocomplete

Once selected, you may want to check or tweak elements styles using jQuery’s neat hasClass/addClass/removeClass/toggleClass helpers. Needless to say, our IDE will remind you all the jQuery functions names with the bold highlight:

then give an insight on method parameters:

Great! Now WebStorm can help you with the CSS classes themselves:

By the way, you can instantly have all the official docs for any jQuery function in context just by using External documentation action (Shift+F1):

Phpstorm Jquery Click Deprecated

In WebStorm, there are tons of helpful features packed: navigating through the code and inspecting it, checking for errors and potential problems, code refactorings etc. etc. Just keep following this blog as we will show you lot more cool stuff soon!

All the features are available in the latest WebStorm and PhpStorm EAP builds and in all the other products based on IntelliJ IDEA platform.

Phpstorm Jquery 補完

As usual: feel free to report any problems that you have in bug tracker. We will instantly answer all your questions at the forum.

Webstorm Ide

Happy coding!
JetBrains Web IDE Team