1

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?

2 Answers 2

2

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.

4
  • Heh, seconds ahead of me. :)
    – Rarst
    Commented Sep 22, 2010 at 11:22
  • @Rarst: Thanks for recognizing who has the fastest gun :-)
    – Jan Fabry
    Commented Sep 22, 2010 at 14:32
  • In the end I add an action using the admin_head hook
    – Extrakun
    Commented Sep 23, 2010 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. Commented Oct 5, 2011 at 11:41
1

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 and acknowledge you have read our privacy policy.

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