It is used in the mvc project. With the help of the jq function, the jq framework and related js and css are first reflected.
@ Section head {
<Link href = "@ Url. Content ("~ /Content/Site.css ")" rel = "stylesheet" type = "text/css"/>
<Script src = "@ Url. Content ("/Scripts/jquery-1.4.4.min.js ")" type = "text/javascript"> </script>
<Script src = "@ Url. Content ("/Scripts/jquery. easyui. min. js ")" type = "text/javascript"> </script>
<Script src = "@ Url. Content ("/Scripts/jquery. validate. min. js ")" type = "text/javascript"> </script>
<Script src = "@ Url. Content ("/Scripts/jquery. validate. unobtrusive. min. js ")" type = "text/javascript"> </script>
<Link href = "@ Url. Content ("/Content/jquery.autocomplete.css ")" rel = "stylesheet" type = "text/css"/>
<SCRIPT src = "@ URL. Content ("/scripts/jquery. autocomplete. js ")" type = "text/JavaScript"> </SCRIPT>
<SCRIPT type = "text/JavaScript">
Function findvalue (Li)
{
If (Li = NULL) return alert ("not found ");
If (!! Li. Extra)
VaR svalue = Unescape (Li. Extra [0]);
}
Function selectitem (Li)
{
Findvalue (LI );
}
$ (Document). Ready (function ()
{
$ ("# Test "). autoComplete ("/area1/en-US/sky/getnamelist1", // here I have added a region and must write the complete path if there is no region/controller/Action
{
Delay: 10,
Minchars: 1,
Matchsubset: 1,
Cachelength: 1,
Onitemselect: selectitem,
Onfindvalue: findvalue,
AutoFill: True,
Maxitemstoshow: 20
});
});
</SCRIPT>
}
Action method:
Public contentresult getnamelist1 ()
{
String name = "A \ Nb \ nc \ nd \ ne \ NF \ ng \ NH \ NJ \ n ";
Return content (name );
}
HTML:
<Input id = "test" type = "text"/>
This function is simply implemented, so it cannot be said that JQ is powerful!