Friday, 26 May 2017

Node webkit loading page by window.location.href and require is not a function

I have application writen in node webkit. I have three pages: login screen login.html , dashboard.html and page that is downloaded from server, unpacked from zip and fired by window.location.href from local directory. This is the main functionality of application, give user ability to login to repository of applications and get the latest code of "game".

In login.html and dashboard.html node js is working properly. Login app uses window.location.href to load dashboard after sucesful login. The problem is that another page, loaded from local directory has problems with "require". Does someone knows why in first pages require is function, and in another is not.

There is node-remote package, but this page is not loaded from remote server. This page is loaded from local storage.

Am i misiing some behavior of nodejs. Is NodeJS code and all pages compiled on application start? or they are added to object of nodejs.



via Zbigniew Adam Karski

No comments:

Post a Comment