eHow launches Android app: Get the best of eHow on the go.

How To

How to Execute JavaScript With Firebug

Contributor
By eHow Contributing Writer
(2 Ratings)

Firebug is Firefox add-on that allows you to experiment, test and troubleshoot HTML, CSS or JavaScript code on any website. Firebug is extremely useful when developing web pages and it displays an error message log to help you troubleshoot websites. You can also use it to set breakpoints or test the performance of the site's JavaScript functions.

Difficulty: Moderate
Instructions
  1. Step 1

    Sign into your Firebug account on the website on which you want to execute the JavaScript. Navigate to the Document Object Model (DOM) pane of Firebug.

  2. Step 2

    Click on the "JavaScript Executor" button on the console page. It is located next to the red arrow on the left side.

  3. Step 3

    Press the yellow arrow at the bottom of the JavaScript executor window to see a multi-line executor.

  4. Step 4

    Enter one or two command lines to execute and press "Enter."

  5. Step 5

    Test the website's JavaScript functions and set benchmarks. Add "console.profile([title])" to the start of the JavaScript function and "console.profileEnd()" to the end of the functions you want to benchmark.

  6. Step 6

    Switch to the "Script" tab and select a breakpoint from the drop-down list of functions. Click on the number in the left side to set the breakpoint. JavaScript pauses at a particular piece to view the value of the variable.

Tips & Warnings
  • Use Firebug's benchmark function to test where your website's performance is failing.
  • Use the breakpoint function to test the different values of variables within your web page.
Subscribe

Post a Comment

Post a Comment

Related Ads

  • Have you done this? Click here to let us know.
I Did This
Get Free Internet Newsletters

Copyright © 1999-2009 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy .   en-US Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License. † requires javascript

Demand Media
eHow_eHow Technology and Electronics