Hi getting console errors for The Following Script
function setPanels()
{
var windowWidth = window.innerWidth;
if(windowWidth < 700)
{
document.getElementById('border1').src = '<?php echo home_url(); ?>/wp-content/uploads/2020/08/PageBorder1-e1597907750528.png';
}
else{
document.getElementById('border1').src = '<?php echo home_url(); ?>/wp-content/uploads/2020/08/PageBorder1.3.png';
}
}
I understand its refering to the Bottom Else Being null but what is null about this expresion?
Error:
Uncaught TypeError: Cannot set property 'src' of null
Is there a way to Ignore the error ? So that it doesn't keep iterating on the console
border1
– tmhao2005