You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's because there are a mix of ' and " in there. Just change all the " to ' in the JS and you'll be fine. It's because PHP thinks the " is the end of a PHP instruction, when it isn't.
I use the default js script with a Wordpress 3.3 website and it works perfect.
echo "<script>document.cookie='resolution='+Math.max(screen.width,screen.height)+'; path=/';</script>";
When i change the default js with the alternate one for retina support (copied from the adaptive-images website) inside the echo command:
echo "<script>document.cookie='resolution='+Math.max(screen.width,screen.height)+("devicePixelRatio" in window ? ","+devicePixelRatio : ",1")+'; path=/'; </script>";
it returns a parse error:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'
I've noticed that for the script you posted on your reply for Issue #36 (closed) you use different syntax:
<script>document.cookie='resolution='+(Math.max(screen.width,screen.height)*("devicePixelRatio" in window ? devicePixelRatio : 1))+'; path=/';</script>
I tried this version too but still returns the same error.
The text was updated successfully, but these errors were encountered: