How to check whether application is foreground or background?

How to check whether application is foreground or background?

BY 02 Nov 2015 Web Code Snippet
■ Summary

Now Tizen Web Developer cannot control the lifecycle of the web application.
But if developer uses the blur and focus event, developer can manage the application status of the foreground and background.
Written by