Running javascript in windows

Как включить JavaScript в Windows

Аннотация

Многие веб-сайты в Интернете содержат JavaScript, язык программирования сценариев, который работает в веб-браузере, чтобы сделать конкретные функции на веб-странице функциональными. Если JavaScript был отключен в вашем браузере, содержание или функциональность веб-страницы могут быть ограничены или недоступны. В этой статье описаны шаги для включения JavaScript в веб-браузерах.

Дополнительная информация

Исследователь Интернета

Чтобы все веб-сайты в зоне Интернета запускали скрипты в Internet Explorer:

В меню веб-браузера нажмите «Инструменты» или значок «Инструменты» (который выглядит как шестерня) и выберите параметры Интернета.

При открытии окна «Интернет-опционы» выберите вкладку Безопасности.

На вкладке «Безопасность» убедитесь, что интернет-зона выбрана, а затем нажмите на «Таможенный уровень. » Кнопку.

В настройках безопасности — диалоговом поле «Интернет-зона» нажмите «Включить» для активного сценария в разделе Сценарий.

Когда открывается окно «Предупреждение!» и спрашивает: «Вы уверены, что хотите изменить настройки для этого zone?» выберите «Да»

Нажмите OK в нижней части окна Опционов Интернета, чтобы закрыть диалог.

Нажмите кнопку Обновления, чтобы обновить страницу и запустить скрипты.

Чтобы разрешить написание сценариев на определенном веб-сайте, оставляя сценарий отключенным в зоне Интернета, добавьте определенный веб-узел в зону «Доверенные сайты»:

В меню веб-браузера нажмите «Инструменты»или значок «Инструменты» (который выглядит как шестерня) и выберите параметры Интернета.

При открытии окна «Интернет-опционы» выберите вкладку Безопасности.

На вкладке «Безопасность» выберите зону «Доверенные сайты», а затем нажмите кнопку «Сайты».

Для веб-сайта (ы) вы хотели бы разрешить сценарий, введите адрес в Добавить этот веб-сайт в зону текстового окна и нажмите Добавить. Примечание: Если адрес не начинается с «https:», вам многие должны отменить проверку «Требуемая проверка сервера (https:) для всех участков в этой зоне».

Нажмите Закрыть, а затем нажмите OK в нижней части окна Интернет опционов, чтобы закрыть диалог.

Нажмите кнопку Обновления, чтобы обновить страницу и запустить скрипты.

Google Chrome

Чтобы включить JavaScript в Google Chrome, пожалуйста, просмотрите и следуйте инструкциям, предоставленным на Enable JavaScript в вашем браузере, чтобы увидеть объявления на вашемсайте.

Firefox корпорации Mozilla

Для включения JavaScript в Firefox, пожалуйста, просмотрите и следуйте инструкциям, предоставленным в настройках JavaScript для интерактивных веб-страниц.

How to enable JavaScript in Windows

Summary

Many Internet Web sites contain JavaScript, a scripting programming language that runs on the web browser to make specific features on the web page functional. If JavaScript has been disabled within your browser, the content or the functionality of the web page can be limited or unavailable. This article describes the steps for enabling JavaScript in web browsers.

More Information

Internet Explorer

To allow all websites within the Internet zone to run scripts within Internet Explorer:

On the web browser menu, click Tools or the «Tools» icon (which looks like a gear), and select Internet Options.

When the «Internet Options» window opens, select the Security tab.

On the «Security» tab, make sure the Internet zone is selected, and then click on the «Custom level. » button.

In the Security Settings – Internet Zone dialog box, click Enable for Active Scripting in the Scripting section.

When the «Warning!» window opens and asks, «Are you sure you want to change the settings for this zone?» select Yes.

Click OK at the bottom of the Internet Options window to close the dialog.

Click the Refresh button to refresh the page and run scripts.

To allow scripting on a specific website, while leaving scripting disabled in the Internet zone, add the specific Web site to the Trusted sites zone:

On the web browser menu, click Tools, or the «Tools» icon (which looks like a gear) and select Internet Options.

Читайте также:  Активированная windows 10 требует активации

When the «Internet Options» window opens, select the Security tab.

On the «Security» tab, select the Trusted sites zone and then click the Sites button.

For the website(s) you would like to allow scripting, enter the address within the Add this website to the zone text box and click Add. Note: If the address does not begin with «https:», you many need to uncheck «Require server verification (https:) for all sites in this zone».

Click Close and then click OK at the bottom of the Internet Options window to close the dialog.

Click the Refresh button to refresh the page and run scripts.

Google Chrome

To enable JavaScript in Google Chrome, please review and follow the instructions provided at Enable JavaScript in your browser to see ads on your site.

Mozilla Corporation’s Firefox

To enable JavaScript in Firefox, please review and follow the instructions provided at JavaScript settings for interactive web pages.

The Console as a JavaScript environment

The Console tool inside the browser DevTools is a REPL environment. It means that you may write any JavaScript in the Console that runs immediately.

To try it, complete the following actions.

  1. Open the Console.
    • Select Control + Shift + J (Windows, Linux) or Command + Option + J (macOS).
  2. Type 2 + 2 . The Console already displays the result 4 on the next line while you type it. The Eager evaluation feature helps you write valid JavaScript. It displays the result while you type whether it’s wrong or if a valid result exists.

Console displays the result of 2 + 2 live as you type it

If you select Enter , the Console runs the JavaScript command, gives you the result, and allows you to write the next command.

Run several JavaScript expressions in succession

Autocompletion to write complex expressions

The last example may seem scary, but the Console helps you write complex JavaScript using an excellent autocompletion feature. This feature is a great way to learn about methods you didn’t know before.

To try it, complete the following actions.

  1. Type doc .
  2. Choose document from the dropdown menu.
  3. Select the tab key to choose it.
  4. Type .bo .
  5. Select tab to get document.body .
  6. Type another . to get a large list of possible properties and methods available on the body of the current webpage.

Console autocompletion of JavaScript expressions

Console history

As with many other command-line experiences, you also have a history of commands. Select Arrow Up to display the commands you entered before. Autocompletion also keeps a history of the commands you previously typed. You may type the first few letters of earlier commands and your previous choices display in a textbox.

Also, the Console also offers quite a few utility methods that make your life easier. For example, $_ always contains the result of the last expression you ran in the Console.

Multiline edits

By default, the Console only gives you one line to write your JavaScript expression. You code runs when you select Enter . The one line limitation may frustrate you. To work around the one line limitation, select Shift + Enter instead of Enter . In the following example, the value displayed is the result of all the lines run in order.

Select Shift + Enter to write several lines of JavaScript and the resulting value is run in order

If you start a multiline statement in the Console, it gets automatically recognized and indented. For example, if you start a block statement with a curly brace.

Network requests using top-level await()

Other than in your own scripts, Console supports top level await to run arbitrary asynchronous JavaScript in it. For example, use the fetch API without wrapping the await statement with an async function.

To get the last 50 issues filed on the Microsoft Edge Developer Tools for Visual Studio Code GitHub repo, complete the following actions.

Open the Console.

Copy and paste the following code snippet to get an object that contains 10 entries.

The 10 entries are hard to recognize, since a lot of information is displayed. Luckily enough, you may use the console.table() log method to only receive the information in which you’re interested.

To reuse the data returned from an expression, you may use the copy() utility method of the Console. The following code snippet sends the request and copies the data from the response to the clipboard.

Читайте также:  Поврежден системный том windows 10

Use the Console as a great way to practice JavaScript functionality and to do some quick calculations. The real power is the fact that you have access to the window object. You may interact with the DOM in Console.

Getting in touch with the Microsoft Edge DevTools team

Use the following options to discuss the new features and changes in the post, or anything else related to DevTools.

  • Send your feedback using the Send Feedback icon or select Alt + Shift + I (Windows, Linux) or Option + Shift + I (macOS) in DevTools.
  • Tweet at @EdgeDevTools.
  • Submit a suggestion to The Web We Want.
  • To file bugs about this article, use the following Feedback section.

The Send Feedback icon in Microsoft Edge DevTools

Консоль как среда JavaScript The Console as a JavaScript environment

Консольный инструмент в браузере DevTools — это среда REPL. **** The Console tool inside the browser DevTools is a REPL environment. Это означает, что вы можете написать любой JavaScript в консоли, которая запускается немедленно. It means that you may write any JavaScript in the Console that runs immediately.

Чтобы попробовать, выполните следующие действия. To try it, complete the following actions.

  1. Откройте консоль. Open the Console.
    • Выберите Control + Shift + J (Windows, Linux) Command + Option + J или (macOS). Select Control + Shift + J (Windows, Linux) or Command + Option + J (macOS).
  2. Введите 2 + 2 . Type 2 + 2 . Консоль уже отображает результат на 4 следующей строке при введите его. The Console already displays the result 4 on the next line while you type it. Эта Eager evaluation функция поможет вам написать допустимый JavaScript. The Eager evaluation feature helps you write valid JavaScript. Он отображает результат при введите, является ли он неправильным или существует допустимый результат. It displays the result while you type whether it’s wrong or if a valid result exists.

Консоль отображает результат live при 2 + 2 введите его Console displays the result of 2 + 2 live as you type it

Если выбрать, консоль запускает команду JavaScript, дает результат и позволяет написать Enter следующую команду. **** If you select Enter , the Console runs the JavaScript command, gives you the result, and allows you to write the next command.

Запустите несколько выражений JavaScript последовательно Run several JavaScript expressions in succession

Автозаполнение для записи сложных выражений Autocompletion to write complex expressions

Последний пример может показаться страшным, но консоль помогает писать сложный JavaScript с помощью отличной функции автозаполнения. **** The last example may seem scary, but the Console helps you write complex JavaScript using an excellent autocompletion feature. Эта функция — отличный способ узнать о методах, которые вы раньше не знали. This feature is a great way to learn about methods you didn’t know before.

Чтобы попробовать, выполните следующие действия. To try it, complete the following actions.

  1. Введите doc . Type doc .
  2. Выберите document из меню отсев. Choose document from the dropdown menu.
  3. Выберите tab ключ, чтобы выбрать его. Select the tab key to choose it.
  4. Введите .bo . Type .bo .
  5. Выберите tab для получения document.body . Select tab to get document.body .
  6. Введите другой, чтобы получить большой список возможных свойств и методов, доступных на . теле текущей веб-страницы. Type another . to get a large list of possible properties and methods available on the body of the current webpage.

Автокомплект консоли выражений JavaScript Console autocompletion of JavaScript expressions

История консоли Console history

Как и во многих других опытом командной строки, у вас также есть история команд. As with many other command-line experiences, you also have a history of commands. Выберите, Arrow Up чтобы отобразить команды, которые вы ввели ранее. Select Arrow Up to display the commands you entered before. Автокомплект также сохраняет историю команд, которые вы ранее впечатлили. Autocompletion also keeps a history of the commands you previously typed. Вы можете ввести первые несколько букв предыдущих команд и отображать предыдущие варианты в текстовом ящике. You may type the first few letters of earlier commands and your previous choices display in a textbox.

Кроме того, консоль также предлагает довольно много полезных методов, которые упрощают вашу жизнь. Also, the Console also offers quite a few utility methods that make your life easier. Например, $_ всегда содержит результат последнего выражения, которое вы запустили в консоли. For example, $_ always contains the result of the last expression you ran in the Console.

Читайте также:  Планшет windows surface зарядное устройство

Многолинейные изменения Multiline edits

По умолчанию консоль предоставляет только одну строку для записи выражения JavaScript. By default, the Console only gives you one line to write your JavaScript expression. Код выполняется при выборе Enter . You code runs when you select Enter . Ограничение одной строки может вас расстроить. The one line limitation may frustrate you. Чтобы обойти ограничение одной строки, выберите Shift + Enter вместо Enter . To work around the one line limitation, select Shift + Enter instead of Enter . В следующем примере отображаемая величина является результатом работы всех строк в порядке. In the following example, the value displayed is the result of all the lines run in order.

Выберите, Shift + чтобы написать несколько строк JavaScript, и в результате значение Enter будет работать в порядке Select Shift + Enter to write several lines of JavaScript and the resulting value is run in order

Если вы запустите многолинейное заявление в консоли, оно автоматически распознается и отступит. If you start a multiline statement in the Console, it gets automatically recognized and indented. Например, при запуске блок-заявления с фигурной скобки. For example, if you start a block statement with a curly brace.

Сетевые запросы с помощью верхнего уровня await() Network requests using top-level await()

Кроме собственных скриптов консоль поддерживает верхний уровень, чтобы запустить произвольный асинхронный JavaScript в нем. Other than in your own scripts, Console supports top level await to run arbitrary asynchronous JavaScript in it. Например, используйте fetch API без обертывания заявления await функцией async. For example, use the fetch API without wrapping the await statement with an async function.

Чтобы получить последние 50 проблем, поданных в Microsoft Edge Developer Tools для Visual Studio кода GitHub, выполните следующие действия. To get the last 50 issues filed on the Microsoft Edge Developer Tools for Visual Studio Code GitHub repo, complete the following actions.

Откройте консоль. Open the Console.

Скопируйте и вклейте следующий фрагмент кода, чтобы получить объект, содержащий 10 записей. Copy and paste the following code snippet to get an object that contains 10 entries.

10 записей трудно распознать, так как отображается много информации. The 10 entries are hard to recognize, since a lot of information is displayed. К счастью, метод журнала позволяет получать только интересуемую console.table() информацию. Luckily enough, you may use the console.table() log method to only receive the information in which you’re interested.

Чтобы повторно использовать данные, возвращаемые из выражения, можно использовать метод copy() утилиты консоли. To reuse the data returned from an expression, you may use the copy() utility method of the Console. Следующий фрагмент кода отправляет запрос и копирует данные из ответа на буфер обмена. The following code snippet sends the request and copies the data from the response to the clipboard.

Используйте консоль как отличный способ практиковать функции JavaScript и делать быстрые вычисления. Use the Console as a great way to practice JavaScript functionality and to do some quick calculations. Реальная мощность — это то, что у вас есть доступ к объекту окна. The real power is the fact that you have access to the window object. Вы можете взаимодействовать с DOM в консоли. You may interact with the DOM in Console.

Взаимодействие с командой средств разработчика Microsoft Edge Getting in touch with the Microsoft Edge DevTools team

Используйте следующие параметры, чтобы обсудить новые функции и изменения в столбе или что-либо другое, связанное с DevTools. Use the following options to discuss the new features and changes in the post, or anything else related to DevTools.

  • Отправьте свои отзывы с помощью значка Отправка отзывов или выберите Alt + Shift + I (Windows, Linux) или Option + Shift + I (macOS) в DevTools. Send your feedback using the Send Feedback icon or select Alt + Shift + I (Windows, Linux) or Option + Shift + I (macOS) in DevTools.
  • Чирикать в @EdgeDevTools. Tweet at @EdgeDevTools.
  • Отправка предложения в Веб-мы хотим. Submit a suggestion to The Web We Want.
  • Чтобы файл ошибок об этой статье, используйте следующий раздел Отзыв. To file bugs about this article, use the following Feedback section.

Значок Отправка отзывов в Microsoft Edge DevTools The Send Feedback icon in Microsoft Edge DevTools

Оцените статью