语义UI下拉框出现问题-在Jfiddle中有效,但不适用于本地

时间:2019-04-27 15:06:33

标签: jquery semantic-ui

这个Jfiddle完成了我想要的:http://jsfiddle.net/3kpjt0xd/2/

但是,当我将完全相同的内容放入本地文件并将其加载到网络浏览器中时,它就无法工作(一种主流浏览器类型)。

我在做什么错?是jQuery吗?我相信所有依赖项均已正确加载。是最后的脚本吗?


    <script src="https://terminal.jcubic.pl/js/jquery.terminal-0.4.6.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.10/semantic.js"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.10/semantic.min.css">
    <link rel="stylesheet" href="https://terminal.jcubic.pl/css/jquery.terminal.css">
    <script
            src="https://code.jquery.com/jquery-3.4.0.js"
            integrity="sha256-DYZMCC8HTC+QDr5QNaIcfR7VSPtcISykd+6eSmBW5qo="
            crossorigin="anonymous"></script>


<form class="ui form segment">
    <div class="field">
        <label>States</label>
        <select class="ui fluid search dropdown" multiple="" id="multi-select">
            <option value="">State</option>
            <option value="AL">Alabama</option>
            <option value="AK">Alaska</option>
            <option value="AZ">Arizona</option>
            <option value="AR">Arkansas</option>
            <option value="CA">California</option>
            <option value="CO">Colorado</option>
            <option value="CT">Connecticut</option>
            <option value="DE">Delaware</option>
            <option value="DC">District Of Columbia</option>
            <option value="FL">Florida</option>
            <option value="GA">Georgia</option>
            <option value="HI">Hawaii</option>
            <option value="ID">Idaho</option>
            <option value="IL">Illinois</option>
            <option value="IN">Indiana</option>
            <option value="IA">Iowa</option>
            <option value="KS">Kansas</option>
            <option value="KY">Kentucky</option>
            <option value="LA">Louisiana</option>
            <option value="ME">Maine</option>
            <option value="MD">Maryland</option>
            <option value="MA">Massachusetts</option>
            <option value="MI">Michigan</option>
            <option value="MN">Minnesota</option>
            <option value="MS">Mississippi</option>
            <option value="MO">Missouri</option>
            <option value="MT">Montana</option>
            <option value="NE">Nebraska</option>
            <option value="NV">Nevada</option>
            <option value="NH">New Hampshire</option>
            <option value="NJ">New Jersey</option>
            <option value="NM">New Mexico</option>
            <option value="NY">New York</option>
            <option value="NC">North Carolina</option>
            <option value="ND">North Dakota</option>
            <option value="OH">Ohio</option>
            <option value="OK">Oklahoma</option>
            <option value="OR">Oregon</option>
            <option value="PA">Pennsylvania</option>
            <option value="RI">Rhode Island</option>
            <option value="SC">South Carolina</option>
            <option value="SD">South Dakota</option>
            <option value="TN">Tennessee</option>
            <option value="TX">Texas</option>
            <option value="UT">Utah</option>
            <option value="VT">Vermont</option>
            <option value="VA">Virginia</option>
            <option value="WA">Washington</option>
            <option value="WV">West Virginia</option>
            <option value="WI">Wisconsin</option>
            <option value="WY">Wyoming</option>
        </select>
    </div>
    <div class="ui primary submit button">Submit</div>
    <p class="ui error message"></p>
</form>



    <script>
        $('#multi-select').dropdown();
    </script>

1 个答案:

答案 0 :(得分:0)

听起来像您缺少图书馆。

根据该演示,您需要4个脚本:

  • @RabbitListener(queues = "request") public String handle(String in) { return in.toUpperCase(); } ,来自here
  • 来自here
  • jquery.terminal-0.4.6.min.js
  • 来自here
  • jquery.terminal.css
  • 来自here
  • semantic.js

打开开发工具(在Windows,Linux上为 F12 )。然后点击网络标签。重新加载页面,并观察哪些文件无法加载。