hank
hank

Reputation: 31

trying to get XUI working

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!'>

Upvotes: 3

Views: 2186

Answers (3)

Liam Gooding
Liam Gooding

Reputation: 61

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

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

Upvotes: 5

harry
harry

Reputation: 647

Here you go, this is an example

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

Upvotes: 2

robert
robert

Reputation: 625

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.

Upvotes: 0

Related Questions