This is the original script from bootstrap 4, which also has bootstrap and tether with the same attributes (integrity and crossorigin) so, since it is pretty new, any kind of help will be very appreciated. ![]() ':///jquery-3.1.1.'.'integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n"', false, null) The reason it’s not deferring is because the script tag associated with this cache script has two source urlssort of This causes some strange behavior. And that still doesn't cover inline scripts (which ignore the defer attribute), unless WordPress switches them to typemodule, which has even greater risks of causing breakage. I've already tried: wp_register_script('jquery', 'http'. Deferring a typical Javascript file is simply a matter of adding deferdefer to the Javascript file. WordPress forcibly defers dependants of any script that is deferred, and potentially breaks them. I'm wondering where I can add the two attributes. The wp_register_script takes five parameters (in this case four) $handle, $src, $deps, $ver ($media). ![]() Normally I use PHP and my code looks like: wp_register_script('jquery', 'http'. I'm trying to use the wp_register_script and wp_enqueue_script FUNCTION on WordPress to enqueue a script, which has two attributes: "integrity" and "crossorigin".
0 Comments
Leave a Reply. |