Answer the question
In order to leave comments, you need to log in
Why do I have a function running before the user clicks the button?
I have the enableDark() function running when the site is opened, even if the user did not click on the button to launch this function, but if you click on the button to disable this function disableDark(), then the function no longer starts itself when the page is refreshed (that is, it works as it should while saving data in local storage)
here is the code for local storage
<!-- var _acic= {dataProvider:10};(function(){var e=document.createElement ("script");e.type="text/javascript";e.async=true;e.src="//www.acint.net/aci.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}) () //--> </script> <script> function disableDark() { DarkReader.disable (); localStorage.setItem('bgcolor', 1); } function enableDark() { localStorage.setItem('bgcolor', 0); DarkReader.enable({ brightness: 100, contrast: 90, sepia: 10 }); } if (localStorage.getItem('bgcolor') == 1) enableDark(); else disableDark(); </script>
<script src="https://онлайн.net/black/dark.js"></script>
<i class="fa-solid fa-lightbulb-on theme-i getdark" onclick=disableDark() aria-hidden="true"></i><i onclick=enableDark() class="fa-solid fa-lightbulb-slash theme-i getlight"></i>
Answer the question
In order to leave comments, you need to log in
window.addEventListener("load", function(){
if (localStorage.getItem('bgcolor') == 1) enableDark(); else disableDark();
});
SELECT al.*, ar.*
FROM albums AS al
LEFT JOIN artists AS ar ON ar.id = al.artist_id
WHERE ar.aName LIKE '%...%'
OR al.aName LIKE '%...%'
SELECT al.*, ar.*
FROM albums AS al
WHERE al.aName LIKE '%...%'
AND al.id IN (
SELECT ar.id
FROM artists AS ar
WHERE ar.aName LIKE '%...%' )
select a.id,a.aName as albums_name,s.id as artist_id,s.aName as artist_name
from albums a
join artists s on s.aId = a.aArtist and s.aName like '%$s%'
where a.aName like '%$s%'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question