I have these lines in my view.cshtml:
$("document").ready(function(){
@{
var cx = Json.Encode(ViewBag.x);
var cy = Json.Encode(ViewBag.y);
}
var x = @cx;
var y = @cy;
});
But now there is a red line under ;
in javascript codes and the error is Syntax error
.
What is the problem?