【问题标题】:trying to get XUI working试图让 XUI 工作
【发布时间】:2011-04-13 15:54:22
【问题描述】:

我正在尝试让 javascript 框架 XUI 工作,但无法让它在任何桌面浏览器上工作。更多关于徐在这里...http://xuijs.com/documentation

<script type='text/javascript' src='xui-more-1.0.0.min.js'></script>
<!-- <script type='text/javascript' src='xui-bb-1.0.0.min.js'></script>  -->

<script>

   x$('button').click(function(e){ 
        alert('tee hee!');
    });

   x$('a.navigation').css({ background:'yellow' });

   alert("at least this works!");
</script>

<a href='http://google.com' class='navigation' >this is a link</a>
<br><br>
<input type='button' id='button' value='click me!'>

【问题讨论】:

  • 你用什么浏览器检查它,你得到什么错误?

标签: javascript frameworks xui


【解决方案1】:

Robert- 没有错误,但它不起作用!

尝试:

   x$('#img_del1').on( 'click', function(e){    

同样将js移到页面底部。

我在 XUI 中没有找到 $(document).ready() 的等价物。

【讨论】:

    【解决方案2】:

    给你,这是一个例子

    x$(window).on('load', function() { 
    x$('#button').click(function () {
        alert('Hello');
    });
    });
    

    【讨论】:

      【解决方案3】:

      您需要将代码包装在“就绪”函数中:

      <script type="text/javascript">
      xui.ready(function() { 
          // x$ code in here...
      });
      </script>
      

      【讨论】:

        猜你喜欢
        • 2019-02-01
        • 2015-09-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-03-02
        • 2011-10-02
        • 2015-10-21
        • 1970-01-01
        相关资源
        最近更新 更多