I am working on a project to develop cross platform Desktop application. I selected NW.js for this and it is good as it allows to call Node APIs directly from DOM and also allows us to use existing popular technologies like HTML, CSS, JavaScript, jQuery, Bootstrap to design interactive UI.
There are few more resources for the same problem like Uncaught Error: Bootstrap's JavaScript requires jQuery and Uncaught: Bootstrap's JavaScript requires jQuery but these are related to Web development and I know how to solve that.
NW.js based desktop application has 2 different contexts (check JavaScript Contexts in NW.js) Browser context and Node context. I searched in many places including Github, Gitter & Google group etc. but still I'm struggling.
This is my project structure.
myapp
|
├───index.js
├───node_modules
├───src
│ ├───app
│ ├───assets
│ │ ├───css
│ │ ├───fonts
│ │ ├───images
│ │ │ ├───downloads
│ │ │ ├───gif
│ │ │ ├───png
│ │ │ └───svg
│ │ │ └───colorful
│ │ ├───js
│ │ │ └───ViewerJS
│ │ │ └───images
│ │ ├───logos
│ │ └───pdfs
│ └───views
│ └───modules
│ ├───code
│ ├───html
│ └───latex
├───package.json
├───package-lock.json
└───test
Inside myapp/src/views/vdir.html
, I have these lines in sequence.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
Now, there are 2 scenarios as follows:
When I run my application using
nw .
( it works fine)nw . --mixed-context
(it throws error on browser console).
Any help would be appreciated. I don't want you to guide me step by step. Just a little suggestion/link/opinion is sufficient.
Thank you all.