document.ready() is not working in MVC4 Razor
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jaganathan BantheswaranPosted Feb 4, 2014, 3:33 AM
Use sections to render the javascript in main view.
in partial view,
@section partialJS
{
// Your js here
}
in Main view,
@RenderSection("partialJS", false)
Jaganathan BantheswaranPosted Feb 4, 2014, 3:31 AM
Sasi ReddyPosted Feb 4, 2014, 3:19 AM
The second alert is not coming in my Razor View
Jaganathan BantheswaranPosted Feb 4, 2014, 1:59 AM
There is no document.ready available. You have to use jquery like this,
$(document).ready(function() {}).
If you are using like this, then let us know code which you are using?