How to Enable JavaScript on iPhone

To enable JavaScript on an iPhone, open Settings > Apps > Safari > Advanced and turn on JavaScript. On iOS 17 and earlier, the path is Settings > Safari > Advanced. JavaScript is on by default, so if a website still won’t load menus, buttons or videos after you’ve checked the switch, something else is usually blocking it. Common culprits are a content blocker, Lockdown Mode or old website data. This guide covers the setting, other browsers, and the fixes to try next.

How to enable JavaScript on iPhone: Settings, Apps, Safari, Advanced, JavaScript, plus fixes for content blockers and Lockdown Mode
The JavaScript switch is at the bottom of the Safari settings. This is a drawing, not a screenshot.

What JavaScript does

JavaScript is the code that makes websites interactive. It powers drop-down menus, image galleries, video players, maps, shopping carts, forms, logins and much more. With it turned off, many sites load as plain text, show a message asking you to enable JavaScript, or don’t work at all. You don’t need to install anything: JavaScript is built into Safari and every other iPhone browser.

Turn on JavaScript in Safari

  1. Open the Settings app.
  2. Tap Apps, then Safari. On iOS 17 or earlier, scroll down and tap Safari on the main Settings screen.
  3. Scroll to the bottom and tap Advanced.
  4. Turn on JavaScript. The switch is green when it’s on.
  5. Go back to Safari and reload the page by tapping the circular arrow in the address bar.

The same steps work on an iPad.

Turn JavaScript off

Follow the same steps and turn the switch off. Some people do this to cut down on ads or to read pages more quickly, but many websites will break. Safari doesn’t let you turn JavaScript on or off for individual sites. The setting applies everywhere.

Chrome, Firefox, Edge and other iPhone browsers

Every browser on the iPhone has JavaScript turned on by default, and most don’t offer a switch to turn it off. If a site works in Safari but not in another browser, try these steps in that browser:

  • Update the app from the App Store.
  • Clear its browsing data from the app’s own settings or history menu.
  • Turn off any ad-blocking or tracking-protection features in the app, at least for that site.

JavaScript is on but the site still doesn’t work

1. Check content blockers

Ad blockers and privacy extensions can stop scripts from running. Go to Settings > Apps > Safari > Extensions and turn them off temporarily. To turn blockers off for one site only, open the site, tap the page menu icon in the address bar and choose the option to turn off content blockers.

2. Check Lockdown Mode

Lockdown Mode is an extreme security setting that blocks some complex web technologies, which can break certain websites. Check Settings > Privacy & Security > Lockdown Mode. If you need it on, you can exclude a trusted site. Open the site in Safari, tap the page menu in the address bar, choose Website Settings and turn off Lockdown Mode for that site.

3. Clear website data

Old or corrupted data can make scripts fail. To clear data for one site, go to Settings > Apps > Safari > Advanced > Website Data and swipe left on the site. To clear everything, use Clear History and Website Data in Safari’s settings. This signs you out of websites. To check what you’ve visited first, see how to see Safari history on an iPhone.

4. Check pop-ups

Some sites use JavaScript to open a payment or login window that Safari blocks. If a button seems to do nothing, see how to turn off the pop-up blocker on an iPhone. You can turn it back on afterwards.

5. Check Screen Time

Screen Time’s content restrictions can stop some websites loading, which can look like a JavaScript problem. Check Settings > Screen Time > Content & Privacy Restrictions.

6. Update and restart

Safari updates arrive with iOS updates. Go to Settings > General > Software Update, install any update, and then restart the iPhone.

7. Try the desktop site

Some mobile pages are buggy. Tap the page menu in the address bar and choose Request Desktop Website.

How to tell whether JavaScript is working

Many websites show a message such as Please enable JavaScript to continue when it’s off. If you see that message after turning the switch on, close the tab, open the page again in a new tab, and work through the fixes above. Another quick test is a well-known site that relies on JavaScript, such as a map or webmail service. If it loads normally, JavaScript is working and the problem is with the original site.

Turn on JavaScript in Safari on a Mac

If a site also misbehaves on your Mac, the switch is in a different place:

  1. Open Safari and choose Safari > Settings from the menu bar.
  2. Click the Security tab.
  3. Tick Enable JavaScript.

The iPhone and Mac settings are separate, so turning JavaScript on in one doesn’t change the other, even if you sync Safari through iCloud.

Is it safe to leave JavaScript on?

Yes, for nearly everyone. Safari runs JavaScript in a sandbox that keeps websites away from your files and other apps, and iOS updates patch security issues regularly. Keeping iOS up to date matters more than turning JavaScript off. If you’re at risk of targeted attacks, Lockdown Mode is the better option, because it limits risky features while leaving most sites usable.

Frequently asked questions

Do I need to download JavaScript?

No. It’s built into every browser. Apps or pop-ups that claim you need to install JavaScript are scams. The same applies on computers. See whether you need to install JavaScript on Windows 10.

Is JavaScript the same as Java?

No. They’re unrelated, despite the name. iPhones don’t run Java in the browser at all.

How do I enable JavaScript on a computer?

Each browser has its own setting. For Windows browsers, see how to enable JavaScript on Windows 11.

Summary

  1. Go to Settings > Apps > Safari > Advanced.
  2. Turn on JavaScript.
  3. Reload the page.
  4. If it still fails, check content blockers, Lockdown Mode and website data.

Get Our Free Newsletter

How-to guides and tech deals

You may opt out at any time.
Read our Privacy Policy