Forums Register Login

Know the Client

+Pie Number of slices to send: Send
How the server know the device type from which request came from. I have requirement to implement the logic based on the type of the device. Eg: Mobile, TAB, PC or Laptop. Is there any existing API in Jquery to know the details about the client?
+Pie Number of slices to send: Send
Well, JQuery doesn't run on the server so maybe that isn't the best way to ask the question. On your server you get all kinds of information about the sender in the HTTP headers, but that would be in your servlet. So I'm going to move this to the Servlets forum.

I don't expect you can distinguish between a PC and a laptop because a laptop IS a PC.
+Pie Number of slices to send: Send
Why do you need to know? Depending upon what you are trying to do, you may not need to know what the device is, but rather what the capabilities are.

For example, if screen size is what you need to know for CSS, then media queries would be used rather than device detection.

We need to know what you are trying to accomplish before putting forward any recommendations.
1
+Pie Number of slices to send: Send
 

Skanth Chang wrote:Is there any existing API in Jquery to know the details about the client?


Sounds like you're barking up the wrong tree with this. I wouldn't try to start from the JQuery end. If anything, you should start with logic running on the server side, like detecting the user agent that made the request. Then you can control the rendering of the response and setting up the page so JQuery can do something accordingly on the client side. But as Bear said, you should explain what you're trying to do in more detail so you get the right recommendations.
+Pie Number of slices to send: Send
If it's simply the acreage of screen you have to work with that you need to know for layout purposes, then you might want to look at something like Bootstrap for your client code.
There are others, but that's the one I have in front of me.

If it's more complex than that then you'd need some other solution.
yeah, but ... what would PIE do? Especially concerning this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 775 times.
Similar Threads
Remote PC file access on a mobile
muliple db's accessed by 1 application server
Sending SMS thru Palm
Objectives for the SCMAD exam are here!!
Client Customised Device Content
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 02:24:29.