About the Template useing in an Electron project

Hi there,sorry I have so many questions.

I wrote a new TMS WEB CORE Electron project, and I used a HTML template STEP by STEP with the offical developers guide.Then everything was perfact except the top-right dropdown menu could not dropdown :joy:.

I tried the same code in a TMS WEB CORE project and it works fine, I also compared the code with Offical DEMO 'Basics\Template UI', when I ran the same code in an Electron project, the top right menu still dose not work.

I checked the code many times, I am quite sure the code is same to the Offical DEMO.So I have no idea if there is something wrong I did or some limitations in the Electron framework?

Thanks.

Do you see any error in the browser console?

Uncaught TypeError: Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.
at Object.jQueryDetection (bootstrap.min.js:6)
at bootstrap.min.js:6
at bootstrap.min.js:6
at bootstrap.min.js:6
bootstrap-notify.js:35 Uncaught ReferenceError: jQuery is not defined
at bootstrap-notify.js:35
at bootstrap-notify.js:37
paper-dashboard.min.js?v=2.0.1:1 Uncaught ReferenceError: PerfectScrollbar is not defined
at paper-dashboard.min.js?v=2.0.1:1
at paper-dashboard.min.js?v=2.0.1:1
electron/js2c/renderer_init.js:111 Electron Security Warning (Insecure Content-Security-Policy) This renderer process has either no Content Security
Policy set or a policy with "unsafe-eval" enabled. This exposes users of
this app to unnecessary security risks.

For more information and help, consult
Security, Native Capabilities, and Your Responsibility | Electron.
This warning will not show up
once the app is packaged.
(anonymous) @ electron/js2c/renderer_init.js:111
DevTools failed to load SourceMap: Could not parse content for file:///C:/Work/Projects/RAD11/ZX/Electron/TMSWeb/Debug/assets/js/_site_dashboard_free/assets/js/dashboard-free.js.map: Unexpected end of JSON input
DevTools failed to load SourceMap: Could not parse content for file:///C:/Work/Projects/RAD11/ZX/Electron/TMSWeb/Debug/assets/css/paper-dashboard.css.map: Unexpected end of JSON input

All message in the console is here.

There is an esay way to test: Copy Demos\Basics\Temple UI\Unit1.html and TMSWeb_TemplateUI.html to a new blank Electron project,run and click the top-right dropdown menu in the main form, then you will find this problem.

The error seems to indicate you haven't added the jQuery library.
If you use Bootstrap 4, you need to add jQuery



I had added the jQuery and included before Bootstrap in the index.html,but these error messages are still shown.

By the way, the same code in a normal TMS WEB CORE project works well, this problem only in an Electron project.

I don't understand what you try to do. You have 2 jQuery references, one local and one via CDN.
I can't see if you effectively added the local ones properly to the TMS WEB Core project and if not, the CDN based references will need to be added BEFORE the bootstrap lib.

Well, first,I added a local jQuery(no CDN at that time) to project, and include it in index.html before Bootstrap,see the first image please.

But there is an error message.As your suggestion, I checked my code,tried to find out why the message was shown even I had already add the iQuery lib.see the second image please.

At last, I had no more idea, so I tried to resolve this problem via adding a CDN lib.

These error message always be shown whatever I did and the same code in a normal TMS WEB Core project works perfact, with no error.

So I come here for help.

Use CDN and put jQuery reference FIRST, before the bootstrap CDN references.
Remove local references if you are unsure whether you properly included them in the project itself.

Everything looks good now, thank you so much.

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.