+ 1

Please anyone find error in this code?

<html> <head> </head> <body onload="redirect()"> <script type="text/javascript"> function redirect() { if (screen.width <= 950) { window.location = "https://www.google.com/"; } </script> bbshd </body> </html>

18th Sep 2017, 9:30 AM
Afam Rk
Afam Rk - avatar
4 Answers
18th Sep 2017, 10:13 AM
Owoeye Philip Oluwaseun
Owoeye Philip Oluwaseun - avatar
+ 1
thank you philip
18th Sep 2017, 10:24 AM
Afam Rk
Afam Rk - avatar
0
Hmmm...
18th Sep 2017, 10:07 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
0
Apparently libe 5 and 9 give the error. Should be the way you use them. Try replacing onload with window.onload in the script
18th Sep 2017, 10:09 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar