JavaScript get_included_files function

A JavaScript equivalent of PHP’s get_included_files
function get_included_files () {
  // http://kevin.vanzonneveld.net
  // +   original by: Michael White (http://getsprink.com)
  // %        note 1: Uses global: php_js to keep track of included files
  // *     example 1: get_included_files();
  // *     returns 1: ['http://kevin.vanzonneveld.net/pj_tester.php']
  var cur_file = {};
  cur_file[this.window.location.href] = 1;
  if (!this.php_js) {
    this.php_js = {};
  }
  if (!this.php_js.includes) {
    this.php_js.includes = cur_file;
  }

  var includes = [];
  var i = 0;
  for (var key in this.php_js.includes) {
    includes[i] = key;
    i++;
  }

  return includes;
}

Example 1
get_included_files();

Should return
['http://kevin.vanzonneveld.net/pj_tester.php']
Теги:
get_included_files
Добавлено: 26 Июля 2018 21:17:11 Добавил: Андрей Ковальчук Нравится 0
Добавить
Комментарии:
Нету комментариев для вывода...