13 Comments

    1. Hi there, the line that says “Opera” is just the nickname. If you look towards the end of that line you’ll see that it’s for “Opera Mini”. Then if you want to JUST target Opera mini, instead of .any in your code, use .Opera.

      Thanks for stopping by! Hope to see you around more!

  1. Will you please provide me the whole code? I’m not good at coding. If my adsense code is abcd, then how I can deactivate abcd in opera mini?

    1. Two things: 1) If you use WordPress, I’m actually in the process of bundling this into a plugin. Watch my blog for updates on that. 2) If you don’t use WordPress, I worked with another developer at FooPlugins to refactor the code to make it ever simpler. Here’s a Gist of that: https://gist.github.com/mathetos/4d80d5c7bf2d23fd2a7e

  2. This is absolutely wonderful. Thanks for coming up in my Google search!

  3. I did something similar, but used C# in the back-end to do the IsMobile() like you wrote in javascript. The server then makes the choice what the user sees and not javascript. I like the server making these choices. If you have javascript making decisions on what the user sees on the client, could lead to things going wrong if your javascript malfunctions. The fact that javascript makes this decision also causes your customer/user to download more content than what they will be looking at. This in a production environment could be a very costly mistake.

    1. Thanks for your feedback. Server side options are useful too, but that doesn’t mean using a JS method is costly or a mistake. Just look at AngularJS, or Backbone and you’ll see tons of really robust functionality being used as clientside.

      After writing this though, I stumbled on WP Mobile Detect (https://wordpress.org/plugins/wp-mobile-detect/) which is a server-side option for WordPress. I haven’t tested it but it’s based on a PHP class that I dug into while researching this article. Worth a look for sure.

  4. Do you need unlimited content for your blog ? I’m sure you spend a lot of
    time writing content, but you can save it for other
    tasks, just search in google: kelombur’s favorite tool

  5. Good post Dear i also think java script is a good way to detect device and redirect device specific page
    ex
    if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
    window.location.href = ‘http://mapofstreet.com’;
    }

    1. I use a similiar script but I use “window.location.replace” instead of “window.location .href”
      ex
      if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
      window.location.replace(“http://yoursite.com/”);
      };

  6. mr.davide says:

    help me check mobile blogger

  7. Choth Tit says:

    hey… if we use for impression ads views… it still load count ?

Leave a Reply

Your email address will not be published. Required fields are marked *