I have the following Jquery Slider initializer that I want to add a simple comma after the end of a line that needs to be programatically populated.
$(function () {
$("#slider").slider({
value: 1,
min: 1,
max: @Model.Offer.PurchaseLimit, <---problematic comma
step: 1,
slide: function (event, ui){
$("#amount").val(ui.value);
}
});
});
The comma gets underlined as a 'syntax error'. My guess is that Razor is trying to interpret the comma.
I have also tried to create a variable outside the javascript function like this:
var PurchaseMax = @Model.Offer.PurchaseLimit; <----problematic semi-colon
But the problem just becomes the semi-colon. What do I do to get this to work?