Hey Ray
It seems I might be taking shortcuts in my development process!
If I move the script to the main page I get this error in DevTools:
Uncaught TypeError: Cannot read properties of null (reading 'length') Menu_dev.php:1012
at intervals (Menu_dev.php:1012:25)
at Menu_dev.php:1016:25
this is from the called script which is using a php variables for time, I would hope they're available as the script runs after php!
I am still keeping the element used in the script on the plugin page here though.
If I move that element to the main page, the script acts on the element on the main page load, and no errors!
if I then call the onClick event to bring in the plugin page with the element on plugin instead, the plugin page shows an empty element, a selectbox in this case.
I'm thinking it might be a DOM issue when the page loads and the script having to reside on the main page
really can't access the plugin page because when the script and element are on plugin page it breaks??
I've run a simple function like:
<p id="demo"></p>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = "Hello World";
}
</script>
and it works.. loading "demo" on the main page before the modal that I call with onClick loads the plugin page.. I get the same results if I try to get that to run on the plugin page...it don't seem to write to the plugin page.
I'm thinking I may have to plugin to the plugin page the script, then plugin that page to the main page...if that makes any sense!
I've attached the files with the 'intervals' script on the main page and the element on the plugin page that will produce the error and blank selectbox,
the DB file as well.
Just a note... when adding the name intervals in Load toDiv wizard, it puts it in '' and it wont work.... your suggestion of removing them on the onClick event
does enable the script to go further.
If you find time to look I will be available...
I think a session may be best to see what is going on...
Let me know..
All the best
Tony