JQuery MVC4 Scripts

I'm used to MVC2 ... where you just add your script links and your sources to the view and just call the jquery and viola function ... You have jQuery working code. But I can't get the jqGrid tableToGrid function to work. I assume I am not loading jquery libraries at all, or I am not running scripts in the right place. Could you take a look at my code and see what might be wrong?

<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>ShowAllEncounters</title>
 <link href="@Url.Content("~/Content/jquery.jqGrid/ui.jqgrid.css")" rel="Stylesheet" type="text/css"/>
</head>

This will be the head ... I used to have scripts related to it ... But it didn’t work ... So I put it outside the tag ... like this ...

</html>
<script src="@Url.Content("~/Scripts/jquery.jqGrid.min.js")" type="text/javascript"/>
<script type="text/javascript">
$(document).ready(function () {
...});

Am I missing something? How can jQuery be used for scripting on an MVC4 site?

I can't even get a fake warning to appear !!!!!!!!!!!!!!

@model IEnumerable<FocusedReadMissionsRedux.Models.TemplateModel>
<!DOCTYPE html>

<html>
<head>
<script src="@Url.Content("~/Scripts/jquery.jqGrid.min.js")" type="text/javascript"/>
<link href="@Url.Content("~/Content/jquery.jqGrid/ui.jqgrid.css")" rel="Stylesheet" type="text/css"/>
   <script type="text/javascript">
       $(document).ready(function () {
        alert("what is going on");
       });
   </script>
   <title>ShowAllEncounters</title>
</head>

UPDATE: , , jquery. . ?

+3
2

"" MVC4 jquery " " _layout.cshtml Bundles.

@Scripts.Render( "~/bundles/jquery" ) _layout.cshtml.

, script include html ...

+4

( ).

/App _Start/BundleConfig.cs.

NoProblemBabe, Bundles Javascript html , Javascript , HTML, .

jQuery $(document).ready( ), . , JS - , . (, , ).

0

All Articles