-6

I was referring to this link: jquery $(window).width() and $(window).height() return different values when viewport has not been resized, to get the size of the screen's width.

Question: In my code, $(window).width() returns 1024. Is 1024 referring to the screen width of the server machine or the client machine?

Community
  • 1
  • 1
Ethyl Casin
  • 791
  • 2
  • 16
  • 34

1 Answers1

1

Javascript is client side langauge and jquery is a javascript library.

Client side language has no power to access server side funcationality.

So obviously that code will return the client side window size.

From Wiki

Client-side scripting generally refers to the class of computer programs on the web that are executed client-side, by the user's web browser, instead of server-side (on the web server). This type of computer programming is an important part of the Dynamic HTML (DHTML) concept, enabling web pages to be scripted; that is, to have different and changing content depending on user input, environmental conditions (such as the time of day), or other variables.

Anik Islam Abhi
  • 25,137
  • 8
  • 58
  • 80