Quantcast
Channel: General developer forum
Viewing all articles
Browse latest Browse all 37677

Re: Adding javascript to page

$
0
0
by Geoffrey Rowland.  

Hi Gareth and Andrew

A big thanks for the pointers to using YUI modules for getting JavaScript into Moodle. They have helped me make considerable progress in getting a Moodle JSmol filter working. Hope to release the code shortly..

One quick YUI newbie question, Is there any practical difference/benefit/preference in using 1. compared to 2. below?  Apart from 2. being slightly more verbose, they both appear to work well in my hands.

Cheers

Geoff

1.

YUI({ ...detail of module... }).use('module', function(Y) { ...JavaScript... });

2.

YUI.applyConfig({ ...detail of module... });
YUI().use('module', function(Y) { ...JavaScript... });

Viewing all articles
Browse latest Browse all 37677

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>