Is there a way to get the drupal(7) module path from which the .js was loaded?
I know that JS is a front-end language, but possibly Drupal passes that info in the Drupal object somehow?
Basicly I want to do something like this:
$('#selectable_html').load("selectable_html.html");
But since Drupal constructs pages on the fly this request transforms to "http://___/node/add/selectable_html.html", which is obviously wrong.
You can pass things to Javascript via Drupal using drupal_add_js using the ‘setting’ option.
You could then pass the path returned from drupal_get_path(‘module’, ‘name’) and access it in Javascript using Drupal.setting.