drupal_add_js and url encoding In my module, I add javascript with a url parameter:

drupal_add_js(libraries_get_path('mylibrary') . '/MyLibrary.js?config=MY_CONFIG_PARAM');


When I view the HTML page source, the line loading the script looks like this:

&lt;script src="http://example.com/sites/all/libraries/mylibrary/MyLibrary.js%3Fconfig%3DMY_CONFIG_PARAM&amp;amp;nbbffw"&gt;&lt;/script&gt;


The '?' and '=' are encoded. Trying to load this script results in an error, because browser can't find it (but if I manually decode it in the browser bar, it's found).

How to add javascript with a parameter, so that it won't get encoded?
Try this code

drupal_add_js(
  url(
    libraries_get_path('mylibrary') . '/MyLibrary.js', 
    array(
      'query' =&gt; array(
        'config' =&gt; MY_CONFIG_PARAM
      )
    )
  )
);