Visual Studio is objecting to the script below and returns a message that says “Expecting More Source Characters”. This I assume is the reason this script won’t fire on the page.
Usually when I get this message in VS it means I forgot a semi colon. However I don’t think that is the case this time. What could be causing this error?
jQuery(document).ready(function ($) {
var Category = "animals";
var BaseURL = "http://localhost:61741/VocabGame/play?cat=";
var URL = BaseURL + Category;
$.getJSON(URL, {
tags: "Pinyin",
tagmode: "any",
format: "json"
},
function (data) {
$('#ChoiceA').append = data.nouns[0].Pinyin;
$('#ChoiceB').append = data.nouns[1].Pinyin;
});
I think you’re missing the closing
})and also have a problem with your.append()lines. Try this: