How do I get the equivalent of "drupal_get_path_alias" in javascript?

Comments

j.somers’s picture

I don't think that's possible.

The drupal_get_path_alias() function does a database lookup of a certain URL to see whether an equivalent alias exists and that's something you can't do using JavaScript.
What you can do instead is using jQuery to perform an $.get() call to a page which returns the result you require and use that.

alim418’s picture

You can use Drupal.settings.thisPage to get current path.

pkej’s picture

Thank you for the help.

Paul K Egell-Johnsen

Paul K Egell-Johnsen