capture external js filename

Discussion in 'Javascript' started by jshanman, Feb 2, 2010.

  1. jshanman

    jshanman Guest

    Hi,

    I am trying to capture the filename of an external script (which I do
    not have access to change). The external script has document.write,
    which I have overridden with my own function dw. This external script
    can be from many sources and the context of the document.write is
    sometimes global and sometimes within named/anonymous functions.

    From within dw, I want to figure out in which external script (by url)
    that the original document.write was called. I am able to do this in
    all major browsers except IE and safari by using the stack trace
    methods and regex parsing.

    Is this possible to accomplish in IE (7+) and Safari?

    Here is my test page:
    http://equipment.forconstructionpros.com/lib/test.php (view source)
    which include the very simple external js file:
    http://equipment.forconstructionpros.com/lib/test.js

    Thanks,
    - Justin
    jshanman, Feb 2, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Sm9l?=

    Extract filename from a filename typed by user

    =?Utf-8?B?Sm9l?=, Aug 23, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,002
    Travis Murray
    Aug 24, 2004
  2. Replies:
    1
    Views:
    1,431
    Roland de Ruiter
    Jun 15, 2006
  3. Ed
    Replies:
    10
    Views:
    45,726
    alok000707
    Jul 13, 2010
  4. Beauregard T. Shagnasty

    Re: filename.gif or filename.gif.jpg?

    Beauregard T. Shagnasty, May 30, 2008, in forum: HTML
    Replies:
    1
    Views:
    733
    Jonathan N. Little
    May 30, 2008
  5. Bergamot
    Replies:
    0
    Views:
    433
    Bergamot
    May 30, 2008
Loading...

Share This Page