• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

javascript loading order in panels

Participant ,
Feb 11, 2018 Feb 11, 2018

Copy link to clipboard

Copied

I am totally confused.

When I open my panel, jquery doesn't want to load. If I then open debug and refresh debug window – jquery loads correctly.

I tried putting my <script> tags:

- in the <head>

- at the end of <body>

- with defer set

- with async set

Also tried different jquery versions

Nothing helps.

If I close and re-open my panel tab – jquery isn't there. If I refresh in debug – it's there.

Any ideas?

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guru , Feb 12, 2018 Feb 12, 2018

In manifest.xml

<CEFCommandLine>

    <Parameter>--mixed-context</Parameter>

</CEFCommandLine>

In index.html

<script>

if (typeof module === 'object') {

    window.module = module;

    module = undefined;

}

if (typeof exports === 'object') {

    window.exports = exports;

    exports = undefined;

}

if (typeof require === 'object') {

    window.require = require;

    require = undefined;

}

</script>

<script src="../js/libs/jquery-3.1.1.min.js"></script>

<script>

if (window.module) module = window.module;

if (window.expor

...

Votes

Translate

Translate
Guru ,
Feb 12, 2018 Feb 12, 2018

Copy link to clipboard

Copied

In manifest.xml

<CEFCommandLine>

    <Parameter>--mixed-context</Parameter>

</CEFCommandLine>

In index.html

<script>

if (typeof module === 'object') {

    window.module = module;

    module = undefined;

}

if (typeof exports === 'object') {

    window.exports = exports;

    exports = undefined;

}

if (typeof require === 'object') {

    window.require = require;

    require = undefined;

}

</script>

<script src="../js/libs/jquery-3.1.1.min.js"></script>

<script>

if (window.module) module = window.module;

if (window.exports) exports = window.exports;

if (window.require) require = window.require;

</script>

I put mine in header but it's not crucial.

HTH

Trevor

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 12, 2018 Feb 12, 2018

Copy link to clipboard

Copied

That is some dark voodoo magic

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 23, 2018 Feb 23, 2018

Copy link to clipboard

Copied

LATEST

You may want to look here, for the reason why dark voodoo magic works 🙂

Davide

Davide Barranca - PS developer and author
www.ps-scripting.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines