0:00
Hello everyone, welcome to Key to Blogging. I am Obscbrady and in this video I will show you how we can force
0:05
user to enable JavaScript in the browser. And I will show you how we can implement it in Blogger and implement in WordPress
0:14
So when someone blocks the JavaScript, most of the function will not work. So suppose let me just disable the JavaScript in this website
0:24
So here I will select the JavaScript to block and let's refresh this
0:29
this page. And as you can see, the menu is not showing here and the sidebar images are gone
0:37
And if I click on the button, it will not work. And here most of the function is disabled
0:44
due to the JavaScript. So you can easily force user to enable this JavaScript. Without
0:51
enabling JavaScript, the page will not load. And so a pop-up to enable the JavaScript. And why
0:59
you should use the script and there are several benefits of it. If you implemented disable
1:04
copy paste using the JavaScript, then anyone can copy the content by just disabling the
1:11
JavaScript in the browser. So you can prevent this by implementing this code. And if you are
1:18
using an anti-ed blog script in your browser, then anyone can bypass this by just disabling the
1:24
JavaScript So there are many ways it can improve your security or your the website So let check how you can enable the JavaScript pop up and force user to enable the JavaScript
1:36
in the browser. So here I'm in the blogger dashboard and here click on theme section and here click on this
1:44
button and make sure to take a backup of your theme. So that if you do anything wrong, you can easily restore it back to the original position
1:53
So here click on Edit HTML. And you have to scroll down to the bottom of this code and search for the closing body tag
2:03
Now you have to paste a code like this and the link of this code is in the description
2:09
So just copy this code and paste it just above the body tag
2:14
Now save your code. Now refresh this page and as you can see the popup is shown and it will ask you to turn
2:25
on the JavaScript in the browser setting and let me just disable the JavaScript code for
2:32
this website. So here I will click on Allow and let's press this page and as you can see
2:42
the pop-up is gone. So in this way you can easily force user to enable the JavaScript and without
2:48
JavaScript the page will not load. And there is a trick that you can apply. Here I have
2:55
added the data block title so it will automatically fetch the website title and so here So if you are using this code in WordPress then you can remove this and you can simply put your
3:08
website name here. So to add this in WordPress, go to the WordPress dashboard and here you can use a plugin like
3:18
header, folder code manager or any other code management plugin or you can directly paste it
3:24
in the theme editor. So I will use this plugin. So click on Add New Snipit
3:35
And here you can set a name like Force Enablejs or something like that to remember this code
3:42
And you can select the option to Sidewide. And here you can select the footer option
3:49
And you can also target this code to specific device, but I will select to all device
3:56
And here I will paste this code and I will change this data block title code to the website
4:03
name and save this code. So let me just add the website name
4:10
Now save this code. Now let's check if this code is working in WordPress
4:16
So open this website in a new tab and let me just disable the JavaScript for this website only
4:26
click on JavaScript and let me just block this and let refresh this page As you can see the JavaScript pop is shown here and here this is the website name that we
4:41
set in the code. So let's again turn on the JavaScript and let's refresh this page
4:52
And as you can see, the pop is gone. So in this way you can easily force user to enable JavaScript in the browser and
5:00
It can help you improve your AdSense revenue. If a user disable JavaScript then the AdSense ad code will not load and your ad will
5:09
not show in the website. And if you have any security measures like disable right click or disable copy paste, then
5:17
it will not work if you are using JavaScript method. So you can easily protect this by using this code
5:25
And by the way, if you want to install Anti-EdBlockScript in your blogger website
5:30
then you can watch this video and if you want to disable copy paste then you can watch
5:35
this video and this video is for blogger and if you want to disable copy paste in
5:41
WordPress then you can watch this CSS tutorial for WordPress and all the links of
5:47
this video will be given in the description I hope this video helps you force user
5:52
to enable JavaScript in the browser and improve the security and if you like
5:58
this video then hit the like button and subscribe to my channel for more upcoming videos
6:02
like this. I will see you in the next video. Thank you