[英]Detect user device and assign different jquery (desktop / mobile(ipad)) in js/ jquery?
[英]jQuery IF statement (Only if a web browser on a desktop) not a mobile device / iPad
jQuery是否有一種簡單的方法本質上具有jQUery / JS if語句,類似於:
IF User is on a web Browser on a desktop... not a mobile device / iPad
謝謝
盡管實際上不建議使用此方法,但這里是:
http://api.jquery.com/jQuery.browser/
摘抄:
因為$ .browser使用navigator.userAgent來確定平台,所以它容易受到用戶的欺騙或瀏覽器本身的虛假陳述。 始終最好盡可能避免使用特定於瀏覽器的代碼。 $ .support屬性可用於檢測對特定功能的支持,而不是依賴$ .browser。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.