16

16Introducing JavaScript and jQuery

16.2

Enabling JavaScript in the browsers

Before we can start using JavaScript (or jQuery) it must be enabled in the web browser, most have it enabled by default — if you haven’t changed the settings you don’t have to do anything, if you are not sure, read on.

I give details for enabling JavaScript on the three most common desktop web browsers; at the time of writing these were (in order): Chrome (69%), Firefox (11%) and Internet Explorer (6%) — IE still?). I got the data from GlobalStats.

16.2.1

Enabling JavaScript in Chrome

I’m using Chrome as my browser of choice; at the time of writing (February 2019), it was on version 72.0.3626.109 this being the most up to date version.

To check your version click the customise and control button at the top right of the screen, it looks like this: Chrome menu, in the dropdown click help and about google chrome. It will display a tab showing the current version:

Figure 16.2 - Chrome — current version
Figure 16.2   Chrome — current version

To make sure that JavaScript is enabled, click the customise and control button at the top right of the screen (Chrome menu) and select settings from the dropdown, this opens a new tab with various settings displayed, scroll to the bottom of the page and expand the advanced section.

The first entry in the advanced section is privacy and security and the bit we are looking for is under content settings (highlighted in orange):

Figure 16.3 - Chrome — Privacy and Security
Figure 16.2   Chrome — Privacy and Security
Figure 16.4 - Chrome — JavaScript settings
Figure 16.4   Chrome — JavaScript settings

Click the arrow on the far right to expand the selection; we’re looking for JavaScript (the sixth entry, Figure 16.4). If this is set to allowed, then JavaScript is enabled and all is well, if not, click the arrow and flick the switch at the top to enable it:

Figure 16.5 - Chrome — enable JavaScript
Figure 16.5   Chrome — enable JavaScript

Now just close the tab, any changes will have been saved.

16.2.2

Enabling JavaScript in Firefox

Enabling JavaScript in the Firefox browser

To check your version click the open menu button at the top right of the screen, it looks like this: Firefox menu, in the dropdown click help and about firefox. It will display a pop-up showing the current version:

Figure 16.6 - Firefox — current version
Figure 16.6   Firefox — current version

It seems to me that Firefox really don’t want you messing about with JavaScript settings, it’s a right palaver to change them. Forget the menu button, it’s not there.

Brace yourself.

In the address bar (where you type a web address) type: about:config. Figure 16.7

Figure 16.7 - Firefox — open configuration page
Figure 16.7   Firefox — open configuration page
Figure 16.8 - Firefox — danger, danger, Will Robinson
Figure 16.8   Firefox — Danger, danger, Will Robinson

This opens the scary “void warranty!” display, treat it with the contempt it deserves and click I accept the risk! (can’t have too many exclamation marks).

This opens up the super, user-friendly configuration page:

Figure 16.9 - Firefox — current version
Figure 16.9   Firefox — current version

Type javascript in the search box at the top and look for the javascript.enabled entry in the list (both highlighted).

The javascript.enabled must have a true in the value column, if it hasn’t just double click the entry to change it. It will be automatically saved.

Fuck me Firefox. I was looking under the menu options for ages. Maybe it’s this sort of thing that puts people off using Firefox in the first place. It’s basic stuff put it on the settings page.

16.2.3

Enabling JavaScript in Internet Explorer

Sigh.

I can’t believe that IE is still the third most popular desktop browser, it’s holding fairly steady at 6% market share, Edge is at 4%. — Anyway:

My version of Internet Explorer is version 11 (I had to do a bit of digging to find it on my machine, I don’t normally use it and I didn’t have any links left to it. It was there though and I was surprised to find that it is still installed as part of Windows 10), to be specific version 11.0.9600.18282. I think this is the latest version.

To check your version click the tools button at the top right of the screen, it looks like a cogwheel: IE menu, in the dropdown click about internet explorer. It will display a pop-up showing the current version:

Figure 16.10 - IE — current version
Figure 16.10   IE — current version

To make sure that JavaScript is enabled, click the tools button at the top right of the screen (IE menu) and select internet options from the dropdown, this opens a pop-up with various settings tabs, select the security tab (Figure 16.11).

Click the custom level button (highlighted) to open the Internet Zone security pop-up (Figure 16.12):

Figure 16.11 - IE — security settings
Figure 16.11   IE — security settings
Figure 16.12 - IE — enable active scripting
Figure 16.12   IE — enable active scripting

Scroll down to scripting (it’s in alphabetical order, it’s near the bottom) and then find active scripting (it’s not called JavaScript).

Make sure that the option is enabled (highlighted in Figure 16.12) by clicking enable.

Click ok to make the change, this will open an are you sure pop-up, click yes and then click ok on the security tab (Figure 16.11) to close the whole thing.

16.2.4

Other browsers

There are plenty of online results for how to enable JavaScript on any browser, just google enable javascript on name-of-brower.

The following site gives a good explanation for all the common browsers: www.enable-javascript.com.



End flourish image