Trying to get XUI to work

I am trying to run the javascript framework XUI, but cannot make it work on any desktop browser. Read more about 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!'>
+3
source share
3 answers

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

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

Here you go, this is an example

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

Robert - no errors, but it doesn’t work!

to try:

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

Also move js to the bottom of the page.

I did not find the equivalent for $ (document) .ready () in XUI.

0
source

Source: https://habr.com/ru/post/1765261/


All Articles