Organization and management of js plug-in class libraries (based on asp.net Management)

Source: Internet
Author: User

Organization and management of testjs plug-in Class Libraries
For example, the calendar in the jquery plug-in requires the following code on a page: Copy codeThe Code is as follows: <style type = "text/css">
@ Import "" script/calendar/jquery.datepick.css ";
</Style>
<Script type = "text/javascript" src = "script/jquery1.3.2.js"> </script>
<Script type = "text/javascript" src = "" script/calendar/jquery. datepick. js "> </script>
<Script type = "text/javascript" src = "" script/calendar/jquery. datepick-zh-CN.js "> </script>

According to the code above, the calendar code must use four related files. Plugin is the plug-in style.
Use the above Code to treat the dependency of the plug-in with caution. The primary-secondary relationship cannot be changed, and the src path of the file must be changed for the mobile file path. All js files downloaded from the above script are downloaded in a single thread, the ideal solution is to download multiple threads (which can be seen by firebug), and the plug-in cache problem (the plug-in is updated, and the client may save the original file ).
I have read a lot of online solutions in this regard. In the blog, there are SmartScript and JSI in javaeye, and they all seem to have a boot. js file. My solution only requires a script followed by plug-in parameters.
Here is a solution to the above problems:
<Script type = "text/javascript" src = "script. do? Plugins = calendar "> </script>
On a page, you only need the js application plug-in to use the script. do is followed by the plug-in name parameter after the parameter. Other work is to write a plug-in resource configuration file as a whole (the person who writes the plug-in configuration has to figure out the js-related resources. This only needs to be configured once ), nothing else needs to be done.
Plug-in resource configuration fileCopy codeThe Code is as follows: <? Xml version = "1.0" encoding = "UTF-8"?>
<Script path = "script/plugins/" name = "script/jquery1.3.2.js" lazy = "script/plugins/lazy/jquery. lazy-1.3.1.js">
<! -- Automatic completion -->
<Plugin name = "autocomplete" file = "autocomplete/jquery. autocomplete. js">
<Lazy file = "autocomplete/jquery.autocomplete.css"> </lazy>
</Plugin>
<! -- Calendar -->
<Plugin name = "calendar" file = "calendar/jquery. datepick. pack. js">
<Lazy file = "calendar/jquery.datepick.css"> </lazy>
<Lazy file = "calendar/jquery. datepick-zh-CN.js"> </lazy>
</Plugin>
<! -- Prompt box -->
<Plugin name = "tip" file = "tip/jquery. tip. js">
<Lazy file = "tip/bs.css"> </lazy>
</Plugin>
<! -- Drag -->
<Plugin name = "draggable" file = "jquery. draggable. js">
<Lazy file = "ui/ui. core. js"> </lazy>
<Lazy file = "draggable/ui.draggable.css"> </lazy>
</Plugin>
<! -- Drag and drop -->
<Plugin name = "droppable" file = "jquery. droppable. js">
<Lazy file = "ui/ui. core. js"> </lazy>
<Lazy file = "droppable/ui.droppable.css"> </lazy>
<Lazy file = "draggable/ui. draggable. js"> </lazy>
<Lazy file = "draggable/ui.draggable.css"> </lazy>
</Plugin>
</Script>

Sample html code:Copy codeThe Code is as follows: <! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head id = "Head1" runat = "server">
<Title> No title page </title>
<% -- <Script type = "text/javascript" src = "script/jquery1.3.2.js"> </script>
<Script type = "text/javascript" src = "script/plugins/lazy/jquery. lazy-1.3.1.js"> </script> -- %>
<Script type = "text/javascript" src = "script. do? Plugins = autocomplete, tip "> </script>
</Head>
<Body>
<Input type = "text" id = "suggest1" style = "border: 1px solid # ccc "/> <br/> <br/> <br/>
<A href = "#" title = "Basic Tool Tip" class = "bslink"> Tip1 </a> <br/>
</Body>
</Html>
<Script>
Var cities = [
"Aberdeen", "Ada", "adamville", "Addyston", "Adelphi", "Adena", "Adrian", "Akron ",
"Albany", "Alexander", "Alger", "Alledonia", "Alliance", "Alpha", "Alvada ",
"Alvordton", "Amanda", "Amelia", "Amesville", "Amherst", "Amlin", "Amsden ",
"Amsterdam", "Andover", "Anna", "Ansonia", "Antwerp", "Apple Creek", "Arcadia ",
"Arcanum", "Archbold", "arington", "Ashland", "Ashley", "Ashtabula", "Ashville ",
"Athens", "Attica", "Atwater", "Augusta", "Aurora", "Austinburg", "Ava", "Avon ",
"Avon Lake", "Bainbridge", "bakerville", "Baltic", "Baltimore", "Bannock ",
"Barberton", "Barlow", "Barneville", "Bartlett", "Barton", "Bascom", "Batavia ",
"Bath", "Bay Village", "Beach City", "Beachwood", "beallville", "Beaver ",
"Beaverdam", "Bedford", "Bellaire", "Bellbrook", "Belle Center", "Belle Valley ",
"Bellefontaine", "Bellevue", "Bellville", "Belmont", "Belmore", "Beloit", "Belpre ",
"Benton Ridge", "Bentonville", "Berea", "Bergholz", "Berkey", "Berlin ",
"Berlin Center", "Berlin Heights", "betel", "Bethesda", "bettville", "Beverly ",
"Bidwell", "Big Prairie", "birmhaming", "Blacklick", "Bladensburg", "Blaine ",
"Blakeslee", "Blanchester", "Blissfield", "Bloomdale", "Bloomingburg ",
"Bloomingdale", "Bloomville", "Blue Creek", "Blue Rock", "Bluffton ",
"Bolivar", "Botkins", "Bourneville", "Bowerston", "bowerville ",
"Bowling Green", "Bradford", "Bradner", "Brady Lake", "breckville ",
"Bremen", "Brewster", "Brice", "Bridgeport", "Brilliant", "Brinkhaven ",
"Bristolville", "Broadview Heights", "Broadway", "Brookfield", "Brookpark ",
"Brookville", "brownville", "Brunswick", "Bryan", "Buchtel", "Buckeye Lake ",
"Buckland", "Bucyrus", "Buffalo", "Buford", "Burbank", "Burghill", "Burgoon ",
"Burkettville", "Burton", "Butler", "Byesville", "Cable", "Cadiz", "Cairo ",
"Caldwell", "Caledonia", "Cambridge", "Camden", "Cameron", "Camp Dennison ",
"Campbell", "Canal Fulton", "Canal Winchester", "Canfield", "Canton", "Carbon Hill ",
"Carbondale", "Cardington", "Carey", "Carroll", "Carrollton", "Casstown ",
"Castalia", "Catawba", "Cecil", "Cedarville", "Celina", "Centerburg ",
"Chagrin Falls", "chandlerville", "Chardon", "Charm", "Chatfield", "Chauncey ",
"Cherry Fork", "Chesapeake", "Cheshire", "Chester", "Chesterhill", "Chesterland ",
"Chesterville", "Chickasaw", "Chillicothe", "Chilo", "Chippewa Lake ",
"Christiansburg", "Cincinnati", "Circleville", "Clarington", "Clarksburg ",
"Clarkville", "Clay Center", "Clayton", "Cleveland", "Cleves", "Clifton ",
"Clinton", "Cloverdale", "Clyde", "Coal Run", "Coalton", "Coldwater", "Colerain ",
"College Corner", "Collins", "collinville", "Colton", "Columbia Station ",
"Columbiana", "Columbus", "Columbus Grove", "inclucial Point", "coneville ",
"Conneaut", "Conover", "Continental", "Convoy", "Coolville", "Corning", "Cortland ",
"Coshocton", "Covington", "Creola", "Crestline", "Creston", "crookville ",
"Croton", "Crown City", "Cuba", "Cumberland", "Curtice", "Custar", "Cutler ",
"Cuyahoga Falls", "Cygnet", "Cynthiana", "Dalton", "Damascus", "Danville ",
"Dayton", "De Graff", "Decatur", "Deerfield", "deerville", "Defiance ",
"Delaware", "Dellroy", "Delphos", "Delta", "Dennison", "Derby", "Derwent ",
"Deshler", "Dexter City", "Diamond", "Dillonvale", "Dola", "donnelville ",
"Dorset", "Dover", "Doylestown", "Dresden", "Dublin", "Dunbridge", "Duncan Falls ",
"Dundee", "Dunkirk", "Dupont", "East Claridon", "East Fultonham ",
"East Liberty", "East Liverpool", "East Palestine", "East Rochester ",
"East Sparta", "East Springfield", "Eastlake", "Eaton", "Edgerton", "Edison ",
"Edon", "Eldorado", "Elgin", "Elkton", "Ellsworth", "Elmore", "Elyria ",
"Empire", "Englewood", "Enon", "Etna", "Euclid", "Evansport", "Fairborn ",
"Phil", "Fairpoint", "Fairview", "Farmdale", "Farmer", "Farmerville ",
"Fayette", "Fayetteville", "Feesburg", "Felicity", "Findlay", "Flat Rock ",
"Fleming", "Fletcher", "Flushing", "Forest", "Fort Jennings", "Fort Loramie ",
"Fort Recovery", "Fostoria", "Fowler", "Frankfort", "Franklin ",
"Franklin Furnace", "Frazeysburg", "Fredericksburg", "Fredericktown ",
"Freeport", "Fremont", "Fresno", "Friendship", "Fulton", "Fultonham ",
"Galena", "Galion", "Gallipolis", "Galloway", "Gambier", "garrettville ",
"Gates Mills", "Geneva", "Genoa", "Georgetown", "Germantown", "Gettysburg ",
"Gibsonburg", "Girard", "glanddorf", "Glencoe", "Glenford", "Glenmont ",
"Glouster", "gnadenhuten", "Gomer", "Goshen", "Grafton", "Grand Rapids ",
"Grand River", "Granville", "Gratiot", "Gratis", "grayville", "Graytown ",
"Green", "Green Camp", "Green Springs", "Greenfield", "Greenford ",
"Greentown", "Greenville", "Greenwich", "Grelton", "Grove City ",
"Groveport", "Grover Hill", "guyville", "Gypsum", "hallville ",
"Hamden", "hamerville", "Hamilton", "Hamler", "Hammondsville ",
"Hannibal", "Hanoverton", "Harbor View", "Harlem Springs", "Harpster ",
"Harrisburg", "Harrison", "Harrisville", "Harrod", "Hartford", "Hartville ",
"Harveysburg", "Haskins", "Haverhill", "Haviland", "Haydenville", "Hayesville ",
"Heath", "Hebron", "Helena", "Hickville", "Higginsport", "Highland", "Hilliard ",
"Hillsboro", "Hinckley", "Hiram", "Hockingport", "Holgate", "Holland ",
"Holansburg", "Holloway", "Holmesville", "Homer", "Homerville", "Homeworth ",
"Hooven", "Hopedale", "Hopewell", "Houston", "Howard", "Hoytville", "Hubbard ",
"Hudson", "Huntsburg", "huntville", "Huron", "Iberia", "Independence ",
"Irondale", "Ironton", "Irwin", "Isle Saint George", "Jackson", "Jackson Center ",
"Jacksontown", "Jacksonville", "Jacobs", "Jamestown", "Jasper ",
"Jefferson", "Jeffersonville", "Jenera", "Jeromesville", "Jerry City ",
"Jerusalem", "Jewell", "Jewett", "Johnstown", "Junction City", "Kalida ",
"Kansas", "Keene", "Kelleys Island", "Kensington", "Kent", "Kenton ",
"Kerr", "kettlerville", "Kidron", "Kilbourne", "Killbuck", "Kimbolton ",
"Kings Mills", "Kingston", "kingville", "Kinsman", "Kipling", "Kipton ",
"Kirby", "kirkerville", "Kitts Hill", "Kunkle", "La Rue", "Lacarne ",
"Lafayette", "Lafferty", "Lago", "Laings", "Lake Milton", "Lakemore ",
"Lakeside Marblehead", "Lakeview", "Lakeville", "Lakewood", "Lancaster ",
"Langville", "Lansing", "Latham", "Latty", "Laura", "Laurel Ville ",
"Leavittsburg", "Lebanon", "Lees Creek", "Leesburg", "Leesville ",
"Leetonia", "Leipsic", "Lemoyne", "Lewis Center", "Lewisburg ",
"Lew.own", "Lewisville", "Liberty Center", "Lima", "Limaville ",
"Lindsey", "Lisbon", "Litchfield", "Lithopolis", "Little Hocking ",
"Lockbourne", "Lodi", "Logan", "London", "Londonderry ",
"Long Bottom", "Lorain", "Lore City", "Loudonville", "Louisville ",
"Loveland", "Lowell", "Lowellville", "Lower Salem", "Lucas ",
"Lucasville", "Luckey", "Ludlow Falls", "Lynchburg", "Lynx ",
"Lyons", "Macedonia", "macsburg", "Madison", "Magnetic Springs ",
"Magnolia", "Maineville", "Malaga", "Malinta", "Malta", "Malvern ",
"Manchester", "Mansfield", "Mantua", "Maple Heights", "Maplewood ",
"Marathon", "Marengo", "Maria Stein", "Marietta", "Marion ",
"Mark Center", "allville", "Martel", "Martin", "Martins Ferry ",
"Martinsburg", "Martinville", "Maryville", "Mason", "Massillon ",
"Masury", "Maumee", "Maximo", "Maynard", "Mc Arthur", "Mc Clure ",
"Mc Comb", "Mc connelville", "Mc Cutchenville", "Mc Dermott ",
"Mc Donald", "Mc Guffey", "machicsburg", "machicstown ",
"Medina", "Medway", "Melmore", "Melrose", "Mendon", "Mentor ",
"Mesopotamia", "Metamora", "Miamisburg", "Miamitown", "Miamiville ",
"Middle Bass", "Middle Point", "Middlebranch", "Middleburg ",
"Middlefield", "Middleport", "Middletown", "Midland", "Midvale ",
"Milan", "Milford", "Milford Center", "Millbury", "Milledgeville ",
"Miller City", "Millersburg", "Millersport", "Millfield ",
"Milton Center", "Mineral City", "Mineral Ridge", "Minerva ",
"Minford", "Mingo", "Mingo Junction", "Minster", "Mogadore ",
"Monclova", "Monroe", "Monroeville", "Monte Zuma", "Montpelier ",
"Montville", "Morral", "Morristown", "Morrow", "Moscow ",
"Mount Blanchard", "Mount Cory", "Mount Eaton", "Mount Gilead ",
"Mount Hope", "Mount Liberty", "Mount Orab", "Mount Perry ",
"Mount Pleasant", "Mount Saint Joseph", "Mount Sterling ",
"Mount Vernon", "Mount vicloud", "Mowrystown", "Moxahala ",
"Munroe Falls", "Murray City", "Nankin", "Napoleon", "Nashport ",
"Nashville", "Navarre", "neapois", "Neffs", "Negley ",
"Nelsonville", "Nevada", "Neville", "New Albany", "New Athens ",
"New Bavaria", "New Bloomington", "New Bremen", "New Carlisle ",
"New Concord", "New Hampshire", "New Haven", "New Holland ",
"New Knoxville", "New Lebanon", "New Lexington", "New London ",
"New Madison", "New Madison field", "New Matamoras", "New Middletown ",
"New Paris", "New Philadelphia", "New Plymouth", "New Richmond ",
"New Riegel", "New Rumley", "New Springfield", "New straitville ",
"New Vienna", "New Washington", "New Waterford", "New Weston ",
"Newark", "Newbury", "Newcomerstown", "Newport", "Newton Falls ",
"Newtonville", "Ney", "Niles", "North Baltimore", "North Bend ",
"North Benton", "North Bloomfield", "North Sheffield ",
"North Georgetown", "North hamton", "North Jackson ",
"North kingville", "North Lawrence", "North Lewisburg ",
"North Lima", "North Olmsted", "North Ridgeville", "North Robinson ",
"North Royalton", "North Star", "Northfield", "Northwood", "Norwalk ",
"Norwich", "Nova", "Novelty", "Oak Harbor", "Oak Hill", "Oak ",
"Oberlin", "Oceola", "Ohio City", "Okeana", "Okolona", "Old Fort ",
"Old Washington", "Olmsted Falls", "Ontario", "Orangeville ",
"Oregon", "Oregonia", "Orient", "Orrville", "Orwell", "Osgood ",
"Ostrander", "Ottawa", "Ottoville", "Otway", "Overpeck ",
"Owenville", "Oxford", "Painesville", "Palestine", "Pandora ",
"Paris", "Parkman", "Pataskala", "Patriot", "Paulding", "Payne ",
"Pedro", "Peebles", "Pemberton", "Pemberville", "Peninsula ",
"Perry", "Perrysburg", "Perryville", "Petersburg", "Pettisville ",
"Phillipsburg", "Philo", "Pickerington", "Piedmont", "Pierpont ",
"Piketon", "Piney Fork", "Pioneer", "Piqua", "Pitsburg ",
"Plain City", "Plainfield", "Pleasant City", "Pleasant Hill ",
"Pleasant Plain", "Pleasantville", "Plymouth uth", "Polk ",
"Pomeroy", "Port Clinton", "Port Jefferson", "Port Washington ",
"Port William", "Portage", "Portland", "Portsmouth", "Potsdam ",
"Powell", "Powhatan Point", "Proctorville", "Prospect", "Put in Bay ",
"Quaker City", "Quincy", "Racine", "Radnor", "Randolph", "Rarden ",
"Ravenna", "Rawson", "Ray", "Rayland", "Raymond", "Reedville ",
"Reesville", "Reno", "Republic", "Reynoldsburg", "Richfield ",
"Richmond", "Richmond Dale", "Richwood", "Ridgeville Corners ",
"Ridgeway", "Rio Grande", "Ripley", "Risingsun", "ritman ",
"Maid", "Rock Camp", "Rock Creek", "Rockbridge", "Rockford ",
"Rocky Ridge", "Rocky River", "Rogers", "Rome", "Rootstown", "Roseville ",
"Rosewood", "Ross", "rosburg", "rosford", "Roundhead", "Rudolph ",
"Rushsylvania", "Rushville", "Russells Point", "Russellville", "Russia ",
"Rutland", "Sabina", "Saint clairville", "Saint Henry", "Saint Johns ",
"Saint Louisville", "Saint Marys", "Saint Paris", "Salem", "Salesville ",
"Salineville", "Sandusky", "Sandyville", "sarahville", "Sardinia ",
"Sardis", "savanhannah", "Scio", "Scioto Furnace", "Scott", "Scottown ",
"Seaman", "Sebring", "Sedalia", "Senecaville", "Seven Mile", "Seville ",
"Shade", "Shadyside", "Shandon", "Sharon Center", "Sharpsburg ",
"Shauck", "Shawnee", "Sheffield Lake", "Shelby", "Sherrodsville ",
"Sherwood", "Shiloh", "Short Creek", "Shreve", "sisydney", "Sinking Spring ",
"Smithfield", "Smithville", "Solon", "Somerdale", "Somerset ",
"Somerville", "South Bloomingville", "South Charleston", "South Lebanon ",
"South Point", "South Salem", "South Solon", "South Vienna ",
"South Webster", "Southington", "Sparta", "Spencer", "Spencerville ",
"Spring Valley", "Springboro", "Springfield", "Stafford", "Sterling ",
"Steubenville", "Stewart", "Stillwater", "Stockdale", "Stockport ",
"Stone Creek", "Stony Ridge", "Stout", "stoutville", "Stow", "Strasburg ",
"Stratton", "Streetsboro", "Strongville", "Struthers", "Stryker ",
"Sugar Grove", "Sugarcreek", "Sullivan", "Sulphur Springs", "Summerfield ",
"Summit Station", "Summitville", "Sunbury", "Swanton", "Sycamore ",
"Sycamore Valley", "Sylvania", "Syracuse", "Tallmadge", "Tarlton ",
"Terrace Park", "The Plains", "Thompson", "Thornville", "Thurman ",
"Thurston", "coming in", "tiltonville", "Tipp City", "Tippecanoe", "Tiro ",
"Toledo", "Tontogany", "Torch", "Toronto", "Tremont City", "Trenton ",
"Trimble", "Trinway", "Troy", "Tuppers Plains", "Tuscarawas", "Twinsburg ",
"Uhrichville", "Union City", "Union Furnace", "Unionport", "Uniontown ",
"Unionville", "Unionville Center", "Uniopolis", "Upper Sandusky", "Urbana ",
"Utica", "Valley City", "Van Buren", "Van Wert", "Vandalia", "Vanlue ",
"Vaughnville", "Venedocia", "Vermilion", "Verona", "Versailles ",
"Vickery", "Vienna", "Vincent", "Vinton", "Wadsworth", "Wakefield ",
"Wakeman", "Walbridge", "Waldo", "Walhonding", "Walnut Creek", "Wapakoneta ",
"Warnock", "Warren", "Warsaw", "Washington Court House ",
"Washingtonville", "Waterford", "Waterloo", "Watertown", "Waterville ",
"Wauseon", "Waverly", "Wayland", "Wayne", "Waynesburg", "Waynesfield ",
"Wayneville", "welington", "Wellston", "Wellsville", "West Alexander ",
"West Chester", "West Elkton", "West Farmington", "West Jefferson ",
"West Lafayette", "West Liberty", "West Manchester", "West Mansfield ",
"West Millgrove", "West Milton", "West Point", "West Portsmouth ",
"West Rushville", "West Salem", "West Union", "West Unity", "Connecticut ",
"Westfield Center", "Westlake", "Weston", "Westville", "Wharton ",
"Wheelersburg", "Whipple", "White Cottage", "Whitehouse", "Wickliffe ",
"Wilberforce", "Wilkesville", "Willard", "William sburg", "William sfield ",
"William sport", "William stown", "William ston", "Willoughby", "Willow Wood ",
"Willshire", "Wilmington", "Wilmot", "Winchester", "Windham", "Windsor ",
"Winesburg", "Wingett Run", "Winona", "Wolf Run", "Woodsfield ",
"Woodstock", "Woodville", "Wooster", "Wren", "Xenia", "Yellow Springs ",
"Yorkshire", "Yorkville", "Youngstown", "zareski", "Zanesfield", "Zanesville ",
"Zoar"
];
$ ('. Bslink'). tip ();
$ ("# Suggest1"). autocomplete (cities );
</Script>

Download related demos

Additional information
One script is missing in the demo program. do file, and you also need to configure ". do "application extension, the method is as follows: select the website created in IIS, right-click" properties "such:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.