WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 2 down vote accepted

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.

share|improve this answer
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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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