Ninth Prince has asked for the wisdom of the Perl Monks concerning the following question:

Okay, this isn't a pure PERL question, but my problem involves using PERL to read web pages. There is a javascript subroutine called JSub on this web page http://www.adviserinfo.sec.gov/IAPD/Content/ViewForm/ADV/Sections/iapd_ADVIdentifyingInfoSection.aspx. I would like to be able to look at the code for this subroutine. I know almost nothing about Javascript, but it looks to me like this function is not defined on this page.

I would like to look at the code for this subroutine. Can anyone tell me how I would do that?

Thanks!

  • Comment on reading web pages / how to look at javascript subroutine

Replies are listed 'Best First'.
Re: reading web pages / how to look at javascript subroutine
by ikegami (Patriarch) on Nov 12, 2008 at 17:20 UTC
    There are "SCRIPT" elements with a "src" attribute telling the client to download and execute external scripts and where they are. One of those defined JSub
      Is it possible for me to look at the code for JSub?

        Of course. You can't hide client side JS. You need to look in the srcs of the scripts as ikegami suggested. These ones-

        <script type="text/javascript" language='Javascript' src='/IAPD/In +cludes/Validation/Search/iapd_OrgSearch.js'></script> <script type="text/javascript" language='Javascript' src='/Iapd/ +Includes/iapd_WindowManagement.js'></script> <script type="text/javascript" language='Javascript' src='/Iapd/In +cludes/iapd_SetAndSub.js'></script>

        The function you're after is in the last one. This is pretty basic HTML, though. Good XHTML and JS tutorials would be a good investment before proceeding.

        Yes. Like I said, there are "SCRIPT" elements with a "src" attribute telling the client to download and execute external script s and where they are. Download them!