3

I am trying to get javascript framework XUI working, but having trouble getting it to work on any desktop browser. More on XUI here... 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!'>
hank
  • 31
  • 3

3 Answers3

5

You need to wrap your code in a 'ready' function:

<script type="text/javascript">
xui.ready(function() { 
    // x$ code in here...
});
</script>
Liam Gooding
  • 61
  • 1
  • 3
2

Here you go, this is an example

x$(window).on('load', function() { 
x$('#button').click(function () {
    alert('Hello');
});
});
harry
  • 627
  • 3
  • 9
  • 19
0

Robert- No errors, but it don't work!

try:

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

Also move the js to the bottom of the page.

I haven't found equivalent for $(document).ready() in XUI.

robert
  • 625
  • 3
  • 12
  • 23