xxjapp / xdialog

A simple and beautiful javascript dialog library
https://xxjapp.github.io/xdialog/
Apache License 2.0
26 stars 2 forks source link

JS error in chrome #1

Closed VegaDiscoveries closed 6 months ago

VegaDiscoveries commented 6 months ago

Describe the bug After adding xdialog to my project the code produced an error in the debugger.

To Reproduce Steps to reproduce the behavior:

  1. Add js file to a web page
  2. Open chrome devtools
  3. Open web page in chrome
  4. View error on devtools

Expected behavior Open web page with no errors

Desktop (please complete the following information):

Solution Line 438: document.body.insertAdjacentElement('beforeend', overlayElement); Replace with: var ele = document.body; if (ele) { ele.insertAdjacentElement('beforeend', overlayElement); }

xxjapp commented 6 months ago

@VegaDiscoveries

Thank you for your report. I will fix this problem. Before that you may add the script tag just before like this.

<body>
...

    <script src="xdialog.js"></script>
</body>
xxjapp commented 6 months ago

@VegaDiscoveries

fixed: https://github.com/xxjapp/xdialog/commit/e2e31ea677c737ad300196760ed98a0898ae22e1