victorgr (victorgr) wrote in webdev,

Catch undefined method calls in JS


There is an interesting task. I need to catch any undefined calls in my JS code. Is there a solution?

    function a() {
        alert('Hi, I'm a function!');

    a(); // works great

    a.b(); // call undefined function

So, are there any ways to catch calls a.b() in my function a()?

  • Basic HTML Document

    In this HTML 5 Tutorial we will look at a very basic HTML document. These three HTML tags are required in each HTML document.

  • Google Analytics

    At work we are having a discussion about Google Analytics referencing information by page titles and URL changes (where the node id turns into the…

  • Drupal blocks, beans, etc.

    Hi I need to create "hub pages" (pages with multiple blocks to different areas of a Drupal site) but I have limited access to what I can modify.…

  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.