How to Force users to enable JavaScript in Browser | SpiderBlogging

How to Force users to enable JavaScript in Browser | SpiderBlogging

    Hello Visitors Today I came up with new topic , in this I will share a tutorial in which you can make force users to enable JavaScript to visit your site.

How to Force users to enable JavaScript in Browser | SpiderBlogging
How to Force users to enable JavaScript in Browser | SpiderBlogging

What is JavaScript?

The official name of JavaScript is ECMA Script . JavaScript is a Scripting Language , which is used in all major Browser so good a html Webpage of User Experience of. Now here I have told you that it is a script language, so it is used in the form of code while creating Html Webpage so that it opens only when opening Html page in the webpage in the form of that Html Code.

Whenever we open any Html webpage, then there is also JavaScript in the same HTML webpage and as soon as we open the webpage in any browser that has JavaScript enabled, then all this work depends on a browser.


Where JavaScript will be used?

As I told you above that JavaScript is used with Html but here JavaScript is used in other areas which is something like this.

  1. JavaScript is very much liked by all programmers and it is one of the most popular languages, it is also used to create an attractive webpage with the help of automation and animation. So that the user experience can be good.
  2. If we see today, every person uses Smartphone because it makes our work very easy, but here whatever work we do inside a smartphone, it is done with the help of application and these applications are made with the help of JavaScript. If it is made, then JavaScript has a great contribution in this area as well.
  3. You must have also used many such Android applications, which would have been an application, but the work done in them is done through a browser, then JavaScript is also the contribution of making such an application.
  4. JavaScript is also used to build a server application. In today's time JavaScript is a very popular language which is being used in almost every field.
  5. JavaScript is also used to create a single page web site in which animation can be used.

Why JavaScript is Important?

Most of all your website depends on JavaScript, If you are using blogger you can see the scripts in the theme by visiting Edit HTML. Adsense Adcodes are also made by scripts , So if your users disable js for your website then they will not see any ads on your site and also some of the functions of your theme won't properly.

I have already shared a Working Anti-Adblock Script , But If your visitors block js from your browser then that script won't work, So Install the below code in your theme.


How to Install it on your Site?

Carefully follow below steps to install the code in your site without any errors

  1. First Login to your Blogger Account
  2. Go to Themes Section
  3. Click On Edit HTML
  4. Now Find </head> 
  5. Paste the below code above </head>


 <noscript>
<style>
		body, html{overflow:hidden}
		      #SpiderBlogging {display:none}
		      /* SpiderBlogging Noscript Popup */
		      #SpiderBloggingNoscript {background:rgba(0,0,0,0.85);padding:0;position:fixed;bottom:0;left:0;top:-100px;right:0;z-index:1000;opacity:1;visibility:visible;height:auto;}
		      #SpiderBloggingNoscript svg {width:100px; height:100px}
		      #SpiderBloggingNoscript svg path {fill:#fff}
		      #SpiderBloggingNoscript .isiNoscript{background-color:#008c5f;color:#fff;position:absolute;text-align:center;padding:0 30px 30px 30px;margin:auto;top:30%;left:0;right:0;font-size:1.5rem;font-weight:400;line-height:1.5em;max-width:670px;box-shadow:0 20px 10px -10px rgba(0,0,0,0.15);border:15px solid rgba(0,0,0,.07); overflow:hidden; transition:all .6s cubic-bezier(.25,.8,.25,1); -webkit-transform:translateZ(0); transform:translateZ(0); backface-visibility:visible; transition:all .2s ease-in-out,visibility 0s; transform-origin:bottom center; pointer-events:auto; transform:rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(1); opacity:1; animation:SpiderBloggingWobble .5s; -moz-animation: SpiderBloggingWobble .5s; -webkit-animation:SpiderBloggingWobble .5s; -o-animation:SpiderBloggingWobble .5s}
		      #SpiderBloggingNoscript .isiNoscript:hover{box-shadow:0 20px 10px -10px rgba(0,0,0,0.2);}
		      #SpiderBloggingNoscript .isiNoscript h4, #SpiderBloggingNoscript .isiNoscript .judul{display:inline-block;background:rgba(0,0,0,.07);padding:5px 25px 15px 25px;font-size:2.2rem;font-weight:500;margin-bottom:20px}
	</style>
</noscript>


       5. Now Paste the below code above </body> Tag

  <noscript>
<div id='SpiderBloggingNoscript'>
<div class='isiNoscript'><span class='judul'>Enable Javascript</span>
<br/>
<svg viewBox='0 0 24 24'>
<path d='M3,3H21V21H3V3M7.73,18.04C8.13,18.89 8.92,19.59 10.27,19.59C11.77,19.59 12.8,18.79 12.8,17.04V11.26H11.1V17C11.1,17.86 10.75,18.08 10.2,18.08C9.62,18.08 9.38,17.68 9.11,17.21L7.73,18.04M13.71,17.86C14.21,18.84 15.22,19.59 16.8,19.59C18.4,19.59 19.6,18.76 19.6,17.23C19.6,15.82 18.79,15.19 17.35,14.57L16.93,14.39C16.2,14.08 15.89,13.87 15.89,13.37C15.89,12.96 16.2,12.64 16.7,12.64C17.18,12.64 17.5,12.85 17.79,13.37L19.1,12.5C18.55,11.54 17.77,11.17 16.7,11.17C15.19,11.17 14.22,12.13 14.22,13.4C14.22,14.78 15.03,15.43 16.25,15.95L16.67,16.13C17.45,16.47 17.91,16.68 17.91,17.26C17.91,17.74 17.46,18.09 16.76,18.09C15.93,18.09 15.45,17.66 15.09,17.06L13.71,17.86Z'/>
</svg>
<br/>To access the <data:blog.title.escaped/> turn on Javascript in the browser settings..</div>
</div>
</noscript>
   6. Now Click On Save Theme. 

To Test if its working or not Download Brave Browser and in extension setting open your url with scripts blocked , If you implemented code properly you will a see a banner like below.


 Conclusion:

Its better to use this script on your blogs so that users can experience your site properly. If you have any doubt regarding this you can comment below.