http status code 404 - loading javascript defered -
i'm writing plugin , load several javascripts plugin page this:
$premium_version_nr = edd_sl_item_name === 'wpproductname' ? 'fr-' : 'pr-'; $this->_version_stamp = wp_debug ? time() : $premium_version_nr . myplugin_version_num; $this->_js_min = wp_debug ? '' : '.min';
then enqeue them using code:
wp_enqueue_script( 'wppfm_data-handling-script', esc_url( myplugin_plugin_url . '/includes/data/js/wppfm_ajaxdatahandling' . $this->_js_min . '.js' ), array( 'jquery' ), $this->_version_stamp ); wp_enqueue_script( 'wppfm_data-script', esc_url( myplugin_plugin_url . '/includes/data/js/wppfm_data' . $this->_js_min . '.js' ), array( 'jquery' ), $this->_version_stamp ); wp_enqueue_script( 'wppfm_event-listener-script', esc_url( myplugin_plugin_url . '/includes/user-interface/js/wppfm_feed-form-events' . $this->_js_min . '.js' ), array( 'jquery' ), $this->_version_stamp );
now issue 2 users can't load files because getting 404 errors because these lines set in page source:
<script type='text/javascript' src='http://www.free-version-shop.dev/wp-content/plugins/wp-product-feed-manager/includes/data/js/wppfm_ajaxdatahandling.min.js%20defer?ver=fr-1.6.1'></script> <script type='text/javascript' src='http://www.free-version-shop.dev/wp-content/plugins/wp-product-feed-manager/includes/data/js/wppfm_data.min.js%20defer?ver=fr-1.6.1'></script> <script type='text/javascript' src='http://www.free-version-shop.dev/wp-content/plugins/wp-product-feed-manager/includes/user-interface/js/wppfm_feed-form-events.min.js%20defer?ver=fr-1.6.1'></script>
as can see there has been %20defer string added between .js , ?.
i have no clue cause that. can't replicate , have lot of users javascript loaded fine.
btw> when remove %20defer string, can open file, files there.
can me in correct direction?
Comments
Post a Comment