You may also want to try:
isFollowing: '@(Model.IsFollowing)' === '@true'
and an ever better way is to use:
isFollowing: @Json.Encode(Model.IsFollowing)
More Related Contents:
- Using Razor within JavaScript
- Razor MVC Populating Javascript array with Model Array
- ASP.NET MVC 3 Razor: Include JavaScript file in the head tag
- ASP.NET MVC implement custom validator use IClientValidatable
- Calling ASP.NET MVC Action Methods from JavaScript
- Is it OK to put JavaScript in Partial Views
- Does Angular routing template url support *.cshtml files in ASP.Net MVC 5 Project?
- jQuery: How to traverse / Iterate over a list of object
- Razor/JavaScript and trailing semicolon
- Concat two arrays But concat is not working
- Passing data to a bootstrap modal
- How to pass json POST data to Web API method as an object?
- Render Partial View Using jQuery in ASP.NET MVC
- How to open a URL in a new Tab using JavaScript or jQuery? [duplicate]
- Relative Paths in Javascript in an external file
- How to pass a value to razor variable from javascript variable?
- Using Bootstrap Modal window as PartialView
- Difference between window.location.href and top.location.href
- asp.net-mvc: razor ‘@’ symbol in js file
- jQuery $.cookie is not a function
- How to keep cascade dropdownlist selected items after form submit?
- Passing dynamic javascript values using Url.action()
- Razor Syntax and Javascript
- How to use jQuery UI Calendar/Date PIcker for week rather than day?
- How to limit number of characters per line in text area to a fixed value
- Difference between $.post and $.ajax?
- C# MVC Controller cannot get decimal or double values from Ajax POST request
- ASP.NET MVC Partial view ajax post?
- How to post ASP.NET MVC Ajax form using JavaScript rather than submit button
- Post JavaScript array with AJAX to asp.net MVC controller