jQuery UI - 未捕获的类型错误:对象 [对象对象] 没有方法"选项卡"(在 jade 中)



似乎无法获得此翻译的 HTML...

无论如何,我检查了所有现有的答案并确保:

  1. 语法正确
  2. jQuery 在 jQuery UI 加载之前加载 在我的脚本之前(我什至把然后放在页面的两端......
  3. 确保Jade正确编译为HTML

所以是的,仍然不起作用。有人有想法吗?

法典:

篇一:

link(rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css")
script(src="//code.jquery.com/jquery-1.9.1.js")
script(src="//code.jquery.com/ui/1.10.4/jquery-ui.js")

篇二:

#tabs
  ul
    li 
     a(href='#tabs-1') Tab 1
    li 
     a(href='#tabs-2') Tab 2
    li 
     a(href='#tabs-3') Tab 2
    #tabs-1
    #tabs-2
    #tabs-2

篇三:

script.
  $(function() {
     $( "#tabs" ).tabs();
});

整件事:

doctype html
html(lang='en')
head
    meta(charset='utf-8')
    meta(http-equiv='X-UA-Compatible', content='IE=edge')
    meta(name='viewport', content='width=device-width, initial-scale=1')
    meta(name='description', content='')
    meta(name='author', content='')
    link(rel='shortcut icon', href='')
    title Starter Template for Bootstrap
    link(href='/css/bootstrap.min.css', rel='stylesheet')
    link(href='/css/mystyles.css', rel='stylesheet')
    link(rel='stylesheet', href='codemirror/lib/codemirror.css')
    link(rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css")
    script(src="//code.jquery.com/jquery-1.9.1.js")
    script(src="//code.jquery.com/ui/1.10.4/jquery-ui.js")

  body
   form(name='uploadDL', id='uploadDL', action = '/sendDL', method = 'post')
    .navbar.navbar-inverse.navbar-fixed-top(role='navigation')
      .container-fluid
        .navbar-header
          button.navbar-toggle(type='button', data-toggle='collapse', data-target='.navbar-collapse')
            span.sr-only Toggle navigation
            span.icon-bar
            span.icon-bar
            span.icon-bar
          a.navbar-brand(href='#') DL in JS
        .collapse.navbar-collapse
          ul.nav.navbar-nav
              button.btn.btn-default.navbar-btn(type="submit") Run
        //
          /.nav-collapse 
    br
    .container-fluid
      .col-md-3
          textarea(name = "DLCode", id="DLcode") x=1;y=x+1;z=x+y;t=z+x;a=x+x+x;
      .col-md-9
        .canvas
          #tabs
            ul
              li 
                a(href='#tabs-1') Tab 1
              li 
                a(href='#tabs-2') Tab 2
              li 
                a(href='#tabs-3') Tab 2
            #tabs-1
            #tabs-2
            #tabs-2

       Placed at the end of the document so the pages load faster 
    script(src='codemirror/lib/codemirror.js')
    script(src='codemirror/mode/javascript/javascript.js')
    script.
      var editor = CodeMirror.fromTextArea(document.getElementById("DLcode"), {lineNumbers: true,mode: "javascript"});
    script(src='/js/bootstrap.min.js')
    script(src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js")
    script(src="http://mbostock.github.com/d3/d3.js")   
    script(src='/d3graph.js')
    script.
       $(uploadDL).on('submit', 'form', function(e) {
       var form = e.currentTarget;
       $.ajax({
       url: form.action,         
       type: 'POST',                                             
       data: $(form).serialize(), 
       success: function(response) {renderGraph(response);},
       error: function() {}
       });  
       e.preventDefault();
       });
    script.
      $(function() {
           $( "#tabs" ).tabs();
      });

confliction of jquery试试这个,

jQuery(function() {
     jQuery( "#tabs" ).tabs();
});

另外,您已经包含了两次jquery,删除了第二个。

script(src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js")

最新更新