Internet Explorer will have errors with VB script files en-queued using wp_enqueue_script. This is probably because the output of enqueue script set the script type to 'language/javascript'. Are there any solutions besides manually including the VB script with the theme?


WP_Script always adds text/javascript to the <script> tag, and applies no filter before it returns, there is not much you can do there. You could try to create a subclass of WP_Scripts that has this functionality. If you change the global $wp_scripts to your new class, this might work.

  • Heh, seconds ahead of me. :) – Rarst Sep 22 '10 at 11:22
  • @Rarst: Thanks for recognizing who has the fastest gun :-) – Jan Fabry Sep 22 '10 at 14:32
  • In the end I add an action using the admin_head hook – Extrakun Sep 23 '10 at 8:32
  • Why create a entire class, when you can just insert the <script> tag yourself ? WP_Script's purpose is to minimize conflicts between javascripts. Chances that you find a plugin or theme using vbscript, and the same one you're trying to use, are 0. – onetrickpony Oct 5 '11 at 11:41

Unfortunately script type is hardcoded in WP_Scripts class. If you need extensive queue management for your VBS scripts you will have to extend that class and use own wrapper functions for VB separately.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.