Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #7593

Re: function call location?

From Antony Scriven <adscriven@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: function call location?
Date 2011-10-20 17:13 -0700
Organization http://groups.google.com
Message-ID <20ecde0b-c4e3-44df-9e34-a447753b0fb9@g16g2000yqa.googlegroups.com> (permalink)
References <iVY38EH54GoOFwnv@invalid.uk.co.demon.merlyn.invalid>

Show all headers | View raw


On Oct 20, 7:53 pm, Dr J R Stockton wrote:

 > Within a function body, and without using any of the
 > arguments provided in the call of the function, can the
 > function obtain a reference to the script element from
 > within which it was called, and if so how?  The script
 > element containing the definition of the function is of
 > no interest.

In Firefox, for example, you might be able to do something
with e.stack:

    <html>
    <body>
    <script id="foo">
        var f = function(){
            try{
                qwoazlskjfalksdtjo4tjwf();
            }catch(e){
                alert(e.stack);
                alert(window.documentElement.innerHTML);
            }
        };
    </script
    <script id="bar">
        f();
    </script>
    </body>
    </html>

What's your goal? --Antony

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

function call location? Dr J R Stockton <reply1142@merlyn.demon.co.uk> - 2011-10-20 19:53 +0100
  Re: function call location? Antony Scriven <adscriven@gmail.com> - 2011-10-20 17:13 -0700
    Re: function call location? Dr J R Stockton <reply1142@merlyn.demon.co.uk> - 2011-10-22 18:43 +0100
      Re: function call location? Scott Sauyet <scott.sauyet@gmail.com> - 2011-10-23 10:00 -0700
        Re: function call location? Dr J R Stockton <reply1143@merlyn.demon.co.uk> - 2011-10-24 19:43 +0100
          Re: function call location? Scott Sauyet <scott.sauyet@gmail.com> - 2011-10-25 05:13 -0700
            Re: function call location? Dr J R Stockton <reply1143@merlyn.demon.co.uk> - 2011-10-26 20:13 +0100
      Re: function call location? Antony Scriven <adscriven@gmail.com> - 2011-10-24 02:11 -0700
        Re: function call location? Dr J R Stockton <reply1143@merlyn.demon.co.uk> - 2011-10-25 19:28 +0100
          Re: function call location? Scott Sauyet <scott.sauyet@gmail.com> - 2011-10-26 05:09 -0700
            Re: function call location? Dr J R Stockton <reply1143@merlyn.demon.co.uk> - 2011-10-27 19:27 +0100
              Re: function call location? Antony Scriven <adscriven@gmail.com> - 2011-10-27 17:25 -0700
                Re: function call location? Dr J R Stockton <reply1143@merlyn.demon.co.uk> - 2011-10-29 20:36 +0100

csiph-web