Closed mtmail closed 3 months ago
Move Javascript into a separate file which helps with readability and can be used later to do separate testing or linting.
Small changes only:
index.php
page.php
script.js
<script type="text/javascript"> //<!-- var init_l0_map = {"center":[30,0],"zoom":2,"force":false}; --> </script>
document.querySelector()
document.forms['f'].elements['comment']
document.addEventListener()
L.DomEvent.on()
Nice, I thought of doing it myself last week :)
Move Javascript into a separate file which helps with readability and can be used later to do separate testing or linting.
Small changes only:
index.php
page.php
write a data structure whichscript.js
later reads. Exampledocument.querySelector()
instead ofdocument.forms['f'].elements['comment']
to find DOM elementsdocument.addEventListener()
instead ofL.DomEvent.on()