Picking up on YUI and see some opportunities in using the YQuery tool to load jQuery in a specific implementation where the YUI 3 sandbox approach would be useful.
However, I am struggling to figure out how I can access jQuery functions/variables defined within the YQuery sandbox.
Please see below:
<script type="text/javascript">
YUI().use('gallery-yquery', function(Y) {
var jq = Y.YQuery();
jq.version = '1.7.1';
jq.use( function() {
$.someFunc = function() {
// Some Jquery actions
}
});
});
</script>
...
<input type="button" onclick="$.someFunc();" value="someTest"/>
Is there a way I can get at “$.someFunc” such as from the button?
Note that this example just happens to be YQuery and that the question is on whether/how functions/variables defined within the YUI “sandbox” can be accessed from outside this on the same page.
Use the return value of the use() method, without specifying a callback function as the last parameter.
I guess you might run into concurrency issues if using YUI dynamic loader since you won’t be able to detect when the given instance has every needed dependencies loaded and ready.
via: yuilibrary