XF 2.0 jQuery in a page node

abdfahim

Well-known member
Pretty sure I am missing something silly, but why my XF1 page node consists of plain HTML and jQuery is not working with XF2? It says couldn't load jQuery. Do I need to add jQuery separately?

Code:
<script>
    jQuery(document).ready(function(){
        ..............
    });

   <div>
      .......................
   </div>
</script>
 
Use this instead:
HTML:
<xf:js>
    jQuery(document).ready(function(){
        ..............
    });

    <div>
        .......................
    </div>
</xf:js>
That will defer the script to the footer and it will ensure it runs after jQuery has loaded.
 
Top Bottom