Friday, August 12, 2011

Check Symfony Environment in Javascript

function prefix() {
  return window.location.href.indexOf('frontend_dev.php') != -1 ? '/frontend_dev.php' : '';
}

function example() {
  window.open(prefix()+'/module/action');
}

No comments:

Post a Comment