문제

Hi Guys I downloaded a search box suggestion from the link

Search box suggestion

In it there is a .js file http://code.jquery.com/ui/1.10.3/jquery-ui.js in this link

The .js size of 426kb is the problem. . .Is there anyway that the code inside it can be reduced, or is their any easy coding for search box suggestion. . in jquery or else in javascript Please help me out guys.

도움이 되었습니까?

해결책

Yes, just use the minified version:

http://code.jquery.com/ui/1.10.3/jquery-ui.min.js

This is 223kb. Alternatively, you can "roll your own" by clicking http://jqueryui.com/download/ and choosing the required elements that you need.

다른 팁

If you are using bower, you can alternatively only select the modules you need, and override the jquery's default on your bower.json file. The override section on your bower.json file would then be:

"overrides": {
  "jquery-ui": {
    "main": [
      "ui/core.js",
      "ui/widget.js",
      "ui/mouse.js",
      "ui/position.js",
      "ui/draggable.js",
      "ui/droppable.js",
      "themes/smoothness/jquery-ui.css"
    ]
  }
}

Note that core, widget, mouse and position are required by other modules, so they should be included first (and in that order).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top