Determine HTML page that called a function in an external js file

Posted by UICodes on Stack Overflow See other posts from Stack Overflow or by UICodes
Published on 2010-05-28T18:56:42Z Indexed on 2010/05/28 19:01 UTC
Read the original article Hit count: 141

Filed under:

Is it possible to determine this at runtime?

contents of external.js:

function x() {

  //can i get the path/name of the html file that included this js file?

  //which is test.html

}

contents of test.html

script src="external.js"

© Stack Overflow or respective owner

Related posts about JavaScript