just for fun...
Is it possible to have a .js file that loads jquery from a remote site and then utalizes jquery inside the .js file...
so say site: www.sitea.com... doesn't use jquery. but they find this awesome script on site b that they want to use in their page... so they do a:
<script src="http://siteb.com/cool-script-location/cool-script.js" type="text/javascript" />
now... cool script uses lots of jquery... but since site a doesn't use jquery... could i do something like this in cool-script.js:
document.writeln('<script src="http://siteb.com/jquery-location/jquery-v.v.v.min.js type="text/javascript"><script');
document.writeln('<div class="test">test</div>');
$(document).ready(function() {
$('.test').click(function() {
<!-- cool stuff goes here -->
});
})
This obviously doesn't work in practice or i wouldnt be asking.