VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: man.of.earth on November 04, 2019, 15:39:43 PM

Title: Defered scripts without „src” attribute
Post by: man.of.earth on November 04, 2019, 15:39:43 PM
Hello,

In the VM generated pages, there are about 10 scripts that have the defer attribute set, but do not have a src attribute, so the defer attribute is useless in this case.
A better idea would be to put those scripts to the end of the HTML document.
Title: Re: Defered scripts without „src” attribute
Post by: Milbo on November 04, 2019, 22:37:37 PM
Example? I cant find it
Title: Re: Defered scripts without „src” attribute
Post by: man.of.earth on November 04, 2019, 23:48:47 PM
Here is a page source as example. The page contains dropdowns.
view-source:https://www.proxima-mundi.ro/printuri-pe-canvas-foto-n

Sample code from the page:
<script defer id="cvselvarsee3eece0c6619d1881c8f55e047f6ba3-js" type="text/javascript">//<![CDATA[
jQuery(document).ready(function($){
Virtuemart.setBrowserState=false;
$('select[data-cvsel="field140"]').off('change',Virtuemart.cvFind);
$('select[data-cvsel="field140"]').on('change',{variants:[["/printuri-pe-canvas-foto-n?virtuemart_product_id=39","mare (100 x 67 cm)"],["/printuri-pe-canvas-foto-n?virtuemart_product_id=40","medie (80 x 53 cm)"],["/printuri-pe-canvas-foto-n?virtuemart_product_id=41","mică (60 x 40 cm)"]]},Virtuemart.cvFind);
}); //]]>
</script>