browser-detection

Check if html element is supported

百般思念 提交于 2021-02-07 02:48:31
问题 How to check if html element is supported, datalist for example? MDC says it is supoorted only in Opera and FireFox. 回答1: if ('options' in document.createElement('datalist')) { // supported! } http://diveintohtml5.info/everything.html#datalist 回答2: If someone needs to check for support of other HTML5 elements this could also be used. https://github.com/ryanmorr/is-element-supported From http://ryanmorr.com/determine-html5-element-support-in-javascript/ /* * isElementSupported * Feature test

Check if html element is supported

被刻印的时光 ゝ 提交于 2021-02-07 02:48:20
问题 How to check if html element is supported, datalist for example? MDC says it is supoorted only in Opera and FireFox. 回答1: if ('options' in document.createElement('datalist')) { // supported! } http://diveintohtml5.info/everything.html#datalist 回答2: If someone needs to check for support of other HTML5 elements this could also be used. https://github.com/ryanmorr/is-element-supported From http://ryanmorr.com/determine-html5-element-support-in-javascript/ /* * isElementSupported * Feature test

Is it possible to detect Firefox users in pure CSS?

孤街浪徒 提交于 2020-07-17 06:13:09
问题 Is it possible to detect Firefox Browser only with CSS like IE? for example, IE browser can be detected like: <!--[if IE 7]> /* IMPORTING CSS FOR IE */ <![endif]--> Can be Firefox browser detected like this code? 回答1: Not that I know of, but you can try this: @-moz-document url-prefix() { #my-id { font-size: 100%; } } This website has more options as well You can place this in your CSS file or between your <style type='text/css'> tags in your HTML. Works Fine! 回答2: Nowadays you can use the

best way to determine whether a webpage is viewed in an iframe

断了今生、忘了曾经 提交于 2020-04-30 05:17:06
问题 Is there a way to determine whether the user is using a web page in side and iframe or is it normal browsing using PHP? 回答1: Using the javascript code that @deceze mentioned above (I pasted it in below), if (parent.frames.length > 0) { ... } If the above code noticed the page was displayed within iframe, then call 'IAmInIFRAME.php'(just example) via ajax call. 回答2: You can add some GET parameters to the request while using IFRAME. <iframe src="http://www.example.com/iframe?iframe=1"> But

how to fix browscap.ini error on my web server

梦想与她 提交于 2020-04-07 09:12:08
问题 I use php to build my web page which i upload to my web server. On visit my page this error message display on my webpage that is on my web server but does not display on my wamp serve(my localhost) it work well. Cannot open '/home2/codeplac/public_html/browscap.ini' for reading how can i fix this issue and what exactly do I need to do on my web server thanks 回答1: It is a file that allows you to better recognize which browser is used by the client. Download from the project website: https:/

how to fix browscap.ini error on my web server

自作多情 提交于 2020-04-07 09:11:29
问题 I use php to build my web page which i upload to my web server. On visit my page this error message display on my webpage that is on my web server but does not display on my wamp serve(my localhost) it work well. Cannot open '/home2/codeplac/public_html/browscap.ini' for reading how can i fix this issue and what exactly do I need to do on my web server thanks 回答1: It is a file that allows you to better recognize which browser is used by the client. Download from the project website: https:/

How to detect Microsoft Chromium Edge (chredge , edgium) in Javascript

旧时模样 提交于 2020-02-28 08:25:53
问题 'Edge 75' will be (is?) the first Chromium Based Edge browser. How can I check if this browser is Edge on Chrome ? (What I really want to know is if the browser fully supports data-uri's - https://caniuse.com/#feat=datauri - so feature detection would even be better. If you know a way to do that, I can change the question) 回答1: You could use the window.navigator userAgent to check whether the browser is Microsoft Chromium Edge or Chrome. Code as below: <script> var browser = (function (agent)

Detect if browser has smooth scrolling feature already

Deadly 提交于 2020-01-21 06:44:27
问题 I have added smooth scrolling to a site of mine using this piece of JavaScript when clicking on hash links. $('a[href*=#]') .click(onAnchorClick); function onAnchorClick(event) { return ! scrollTo(this.hash); } function scrollTo(target) { var e = $(target); var y = e.exists() ? e.offset().top : 0; if(y == 0 && target != '#top') return false; if(Math.max($('html').scrollTop(), $('body').scrollTop()) != y) $('html,body') .animate({scrollTop: y}, 500, function() { location.hash = target; } );