On Github rmurphey / wtf3pjs
jQuery Conference / San Diego 2014
jQuery Conference / San Diego 2014
Read more about scout files and deploying JS apps from Alex Sexton.
<script src="//display.bazaarvoice.com/static/Agileville/en_US/bvapi.js"></script>
$.getScript('//display.bazaarvoice.com/static/Agileville/en_US/bvapi.js');
var scripts = document.getElementsByTagName('script'); var firstScript = scripts[0]; // later ... var anotherScript = document.createElement('script'); anotherScript.src = '//display.ugc.bazaarvoice.com/Agileville/bv-primary.js'; firstScript.parentNode.appendChild(anotherScript);
var scripts = document.getElementsByTagName('script'); var firstScript = scripts[0]; var firstScriptParentNode = firstScript.parentNode; // later ... var anotherScript = document.createElement('script'); anotherScript.src = '//display.ugc.bazaarvoice.com/Agileville/bv-primary.js'; firstScriptParentNode.appendChild(anotherScript);
$('body').length; // lol 2
function getBody (document) { return document.body || document.getElementsByTagName('body')[0]; };
function showIt (config) { var myDiv = config.containerId && $('#' + config.containerId); if (myDiv && myDiv.length) { myDiv.append('<p>using configured div</p>'); } else { $('#fallback').append('<p>using fallback div</p>'); } } $('#showIt').click(function () { showIt({ productId : 1234 }); });
function writeReview () { $BV.on('submissionLoad', function () { togglePopup(); }); }
window.exports = { testing : 'all the things', breaking : 'code in funky ways', haikus : 'add more fun' };
I’ll be talking more about this at the Front End Ops Conference in April.