jquery file not firing properly in MVC [Resolved]

Posted by Klbaiju under ASP.NET MVC on 6/27/2016 | Points: 10 | Views : 484 | Status : [Member] | Replies : 1
Hi,

Iam new to MVC. following is a working code

@model System.Data.DataTable
@using System.Data;

<h2>Report</h2>
<html>
<head>
<title>SQLQueryExample</title>
<script language="javascript" type="text/javascript" src="../../Scripts/jquery-1.7.1.js"></script>
<style type="text/css">
table,th,td{border:1px solid black;border-collapse:collapse;}
td{padding:0;text-align:center;}

</style>

</head>
<body>

<table id="GridView3">
<thead>
<tr>
@foreach (DataColumn col in Model.Columns)
{
<th >@col.ColumnName</th>
}
</tr>
</thead>
<tbody>
@foreach (DataRow row in Model.Rows)
{
<tr>
@foreach (DataColumn col in Model.Columns)
{
<td>@row[col.ColumnName]</td>

}

</tr>

}

</tbody>

</table>
<script language="javascript" type="text/javascript" src="../../Scripts/bus.js"></script>
</body>

</html>


problem is jquery file is not firing quickly. it takes some seconds.

so where to add jquery file properly

Regards

Baiju




Responses

Posted by: Rajnilari2015 on: 6/27/2016 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 50

Up
0
Down

Resolved
@Klbaiju Sir,
Please put your JavaScript/JQuery files at the bottom of the page. e.g.

.........................
.........................
</table>
<script language="javascript" type="text/javascript" src="../../Scripts/jquery-1.7.1.js"></script>
<script language="javascript" type="text/javascript" src="../../Scripts/bus.js"></script>
</body>


This increase the rendering progress and thereby enhance the page loading time.

Hope this helps

--
Thanks & Regards,
RNA Team

Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response