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
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.
-
-
@Rarst: Thanks for recognizing who has the fastest gun :-) Commented Sep 22, 2010 at 14: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
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.