Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts

Sunday, July 08, 2018

Why some HTML tags disappear in Wordpress?

Do you have Wordpress powered website, and HTML tags like <form></form>, <input />, <script></script> disappear when you are updating the existing post or page?

Congratulation! You also have found a bug in the security of Wordpress CMS...

Change the author of page/post to the current user or just re-login with a proper Wordpress account.


Friday, May 04, 2018

Online tests for Google Analytics and Tag Manager

I've spent a lot of time setting up and testing different actions using Google Global Site Tag.

Moreover there are at least 3 different versions of installation codes for Google Analytics plus Google Tag Manager.

So I've gathered all these codes in one website and added some testing tools there. For example, you can generate any event on the fly.

Installation Codes and On-line Tests for Google Analytics and Google Tag Manager.


Thursday, March 20, 2014

How to detect Internet Explorer 10 and higher?

For a long time detecting of Internet Explorer browser was easy using Conditional Comments, something like:

<!--[if IE]>
 <script type="text/javascript">
  var isIE = true;
 </script>
<![endif]-->

Starting version 10, Internet Explorer doesn't support conditional comments feature :(

Here is the JavaScript code to detect IE of any version since 5 till 11:

var isIE = (function(){
    var undef,rv = -1; // Return value assumes failure.
    var ua = window.navigator.userAgent;
    var msie = ua.indexOf('MSIE ');
    var trident = ua.indexOf('Trident/');

    if (msie > 0) {
        // IE 10 or older => return version number
        rv = parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
    } else if (trident > 0) {
        // IE 11 (or newer) => return version number
        var rvNum = ua.indexOf('rv:');
        rv = parseInt(ua.substring(rvNum + 3, ua.indexOf('.', rvNum)), 10);
    }

    return ((rv > -1) ? rv : undef);
}());
 

Hope Internet Explorer 12 and higher will work the same way :)