jquery - How to get browser width using JavaScript code? -
I am trying to write the JavaScript function to get the width of the current browser.
I found this one:
javascript: alert (document.body.offsetWidth);
But its problem is that if the body's width is 100% then it fails.
Is there any other better work or an alternative solution?
This is one. I advise to leave the nonsense and the experiment, from which you will get to $ (window). Width ()
.
Comments
Post a Comment