Неопределенный $jQuery в Visual StudioJquery

Программирование на jquery
Ответить
Anonymous
 Неопределенный $jQuery в Visual Studio

Сообщение Anonymous »

Кто-нибудь может мне помочь, как включить jQuery в Visual Studio. У меня возникает ошибка undefed $, когда я включил CDN в файл HTML перед js и установил все расширения jQuery в VS! Я не знаю, что делать; любая помощь приветствуется.
JS-код:

Код: Выделить всё

var buttonColours = ["red", "blue", "green", "yellow"];

var gamePattern = [];

//3. At the top of the game.js file, create a new empty array with the name userClickedPattern.
var userClickedPattern = [];

//1. Use jQuery to detect when any of the buttons are clicked and trigger a handler function.
$(".btn").click(function() {

//2. Inside the handler, create a new variable called userChosenColour to store the id of the button that got clicked.
var userChosenColour = $(this).attr("id");

//4. Add the contents of the variable userChosenColour created in step 2 to the end of this new userClickedPattern
userClickedPattern.push(userChosenColour);

//console.log(userClickedPattern);

});
Похоже, VS не прогнозирует jQuery, я хочу использовать jQuery от VS.

Подробнее здесь: https://stackoverflow.com/questions/784 ... ual-studio
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Jquery»