Presentation is loading. Please wait.

Presentation is loading. Please wait.

JavaScript Development Tools Front-End Development.

Similar presentations


Presentation on theme: "JavaScript Development Tools Front-End Development."— Presentation transcript:

1 JavaScript Development Tools Front-End Development

2 JS Development Tools In order to work with JavaScript, we need to set up a couple of tools Many tools available; we wil go for a quite simple setup: – Aptana Studio 3 – Firefox browser, with – Firebug extension

3 Aptana Studio 3 We need a tool for creating and editing HTML and JavaScript files (not compiling) In principle, we could just use Notepad… We will only use Aptana Studio for – Creating and editing (smart editor) – Launching websites to Firefox

4 Aptana Studio 3 Aptana Studio 3 is free, just download and install Go to www.aptana.com, download and install the version for your OSwww.aptana.com

5 Aptana Studio 3

6 Open a file: File | Open File

7 Aptana Studio 3

8 The Aptana Studio editor provides ”smart” facilities like: – Color coding of page elements – Auto-generation of closing tags – Auto-completion for JavaScript methods, properties, etc.. – …and probably a lot of other stuff we are not really going to use

9 Aptana Studio 3 If you do not like the default color scheme: Choose Themes (the ”color-wheel” icon), and choose a different theme. Current theme is greyed out

10 Firefox Browser Aptana Studio cannot ”run” (display) a website for you – we need a browser for that What to choose… We will use Firefox, mainly because of the Firebug plug-in (later) Go to www.firefox.com, and install Firefox on your PCwww.firefox.com

11 Firefox Browser Once you have installed Firefox, you can set it as the default browser used by Aptana Studio This is done by choosing the menu Run, and then Run Configurations

12 Firefox Browser 1) Select ”Web Browser”… 2) Click ”New Launch Configuration”

13 Firefox Browser 1) Enter a name for the new Run configuration 2) Browse to the Firefox executable 3) Leave rest as-is…

14 Firefox Browser When we now wish to run (display) a website, we should: – In the editor, go to that.html page which is the main page of the website (in our examples, we will typically only have only.html page) – Choose the menu Run, then Run (or Ctrl + F11, or click the green ”Run” icon)

15 Firefox Browser

16 NOTE: A classic mistake: – You edit some JavaScript (a.js file) – You save, and wish to see the website… – …so you click Run, while displaying the.js file in the editor – This will NOT launch the website, but just show the JavaScript directly in the browser – REMEMBER to shift to the.html page in the editor

17 Firebug extension If we always created error-free websites, this would be all we needed… Aptana Studio cannot really help us with ”dynamic” errors, i.e. JavaScript errors The Firebug extension to Firefox can help us with this! Go to getfirebug.com, and install Firebuggetfirebug.com

18 Firebug extension Once Firebug is installed, you can start it in Firefox by: – Pressing F12, or – Clicking on the Firebug icon in the upper right corner

19 Firebug extension You can display the Firebug window either as part of the browser window, or in a separate window (I prefer at the bottom of the screen )

20 Firebug extension

21 We can show/inspect various webpage element, like e.g. JavaScript

22 Firebug extension We can even debug JavaScript, using breakpoints, single- stepping, etc.

23 Firebug extension In the Watch window, we can observe values of variables, etc (also mouse-over)

24 Try it out! Make sure you have all the below installed: – Aptana Studio 3 – Firefox browser – Firebug extension Do JavaScript Exercise 01 (see class website)


Download ppt "JavaScript Development Tools Front-End Development."

Similar presentations


Ads by Google