JQuery can not be found in the MVC project?

Abstract: not found in the MVC JQuery project in?


At first MVC was still a student out to 3.0 and to, when it has finished soldiers out to 5.0, and progress seems to be a soldier when the backward relatively big.

Today would like to open a template to write about MVC JQuery, because the default templates will come directly to the JQuery load, and then very happy to be writing execution, the result was this ghost error !!




Actually told me that $ (JQuery) undefined !!!!! What is witchcraft!
So I decided to check to see if my load JQuery really come ....




After check to make sure there is JQuery load in, so what exactly is part of the tragedy of it?

Turned out to be after 4.0, JQuery have been moved to the last page was loaded, wait until the page elements are loaded before execution begins to load JQuery, it is said it will run faster look.




At the bottom we can see the layout of the JQuery load came in

but we can not put all the JQuery all written in the layout in Afghanistan, are usually written in it at all View -
when we come to see the place below JQuery that there are strip @RenderSection ( "scripts", required: false)
on the page anywhere he would name "scripts" of this section to move to the back of required: false representatives this is not necessary because we do not each page will have js, and now we have a little part of the original js add a point Tintin workers.




Well ... just do a name and a section called scripts, and then we had to write js whole package lost in, so that my js JQuery will be able to eat a normal !!!!

@section not only help us js help move the last page, html can also move on the page where we want to make our website look more tidy, not the East 1 West of XDD

Original: Large columns  can not be found in the MVC project in JQuery?


Guess you like

Origin www.cnblogs.com/chinatrump/p/11505339.html