Home I don't know why JavaScript function for closing a tab errors out
Reply: 0

I don't know why JavaScript function for closing a tab errors out

user544
1#
user544 Published in June 21, 2018, 8:41 am

In my app I have this in the corresponding Angular controller:

     $scope.close_window = function() {
      window.close();
     };

The html template has this:

    <a href="javascript:close_window();">Quit</a>

The button fails to do anything and I see this error in the console:

Uncaught ReferenceError: close_window is not defined

I thought I defined as shown above. Is there something I am missing?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.320129 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO