Im using Play! 1.2.5 and Greenscript 1.2.8b. Im looking to have a fallback for jQuery and other javascript library if one the CDN is not responding.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="@{'public/javascripts/jquery-1.7.2.min.js'}">\x3C/script>')</script>
This works fine but is there a way to do this with Greenscript?
I have tried to do the same thing with greenscript, but other scripts that depends on jQuery loads at the same time and will break the site:
#{greenscript.js 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js' }
window.jQuery || document.write('<script src="@{'public/javascripts/jquery-1.7.2.min.js'}">\x3C/script>')
#{/greenscript.js}
It would be great to have something like this:
js.default=https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js || jquery-1.7.2.min