jQuery v1.8.x-1.12.x .getScript() and .ajax() not executing PlumX external script -
i using plumx widget script publication metrics such this:
https://plu.mx/kaust/w/a/3b-x5905ezrzvemgg_s7ptyz3ajtrxr1geveoir_vmu
the usage simple, use specific html code script tag. here test snippet:
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.8.3.min.js"></script> <script type="text/javascript"> $(window).on('load', function(){ $.getscript('https://code.jquery.com/jquery-3.2.1.min.js', function(){ $.getscript('https://d39af2mgp1pqhg.cloudfront.net/widget-popup.js');});}); </script> <a href="https://plu.mx/kaust/a/?doi=10.1002%2fsmll.201603080" class="plumx-plum-print-popup" data-popup="right" data-hide-when-empty="true" data-site="kaust" data-badge="false">nanomembrane-based, thermal-transport biosensor living cells.: profile on plumx</a> due restrictions on sharepoint site administering, cannot include plumx script tag directly, load jquery's .getscript() approach. before website using jquery version 1.6.1 , working. switched v1.8.3 , externally loaded script stopped executing, although there external script not affected.
here screenshots of network resources tab when page has loaded - before , after:
as should be (errors come script - unavailable (get) resources)
with jquery v1.8.x-1.12.x
i wonder how fix issue. on local copy of webpage acts same way if include plumx widget script tag directly in html works again cannot @ sharepoint side. workaround working me this:
$(window).on('load', function(){ $.getscript('https://code.jquery.com/jquery-3.2.1.min.js', function(){ $.getscript('https://d39af2mgp1pqhg.cloudfront.net/widget-popup.js')});}); it first loads version of jquery after loads plumx widget script. jquery versions other v1.8.x-1.12.x (i.e. v1.2.x-1.7.x , v2.x-3.x) load/run script expected, cannot figure out why when older minified versions task! $(window).on('load') used purpose not break other js code on page. not best practice have jquery script loaded more once, however, necessary. want see if possible fix problem without loading jquery version.
these change logs , release notes help, ajax section:
https://blog.jquery.com/2012/08/09/jquery-1-8-released/
i tried fiddle around altering jquery files without success.
and not find .ajax() combination work v1.8.3.


Comments
Post a Comment