How S40 distributed browser executes javascript in normal web pages and in web apps?

This is specifically about how jquery mobile works differently in web pages in in web apps.

If this example template below is opened in S40 web browser jquery mobile styles are applied as expected. (short link)

If this same exact page is packaged as a web app, jquery mobile styling doesn't work at all. (link to web app)

Jquery mobile styles are applied on page load when jqm javascript code adds css styles to DOM. Because this works differently in web page and in web app, I am assuming that javascript is handled differently between these two cases. Am I right or is there something else behind this?