How to Create Javascript Minifier Tool in Blog - Post or Page

Hey Guys! Welcome back to Techly Series website.
Assuming You are observing the Javascript Minifier Tool Script on blogger. This is the Right Place to you. Since You can get this Script for free and gain deep pocket With Your adsense.
Today, in this article, I will Discuss with you about How to Create Javascript Minifier Tool in Blog - Post or Page.
What is Minification in JavaScript
Minification, otherwise called minimization, is the most common way of eliminating all superfluous characters from JavaScript source code without adjusting its usefulness. This incorporates the evacuation of whitespace, remarks, and semicolons, alongside the utilization of more limited variable names and capacities. Minification of JavaScript code brings about conservative document size.
Disadvantages of Minification
Minification can break muddled scripts due to site-subordinate factors like topics, modules, and server climate. Likewise, minification should be done related to other execution tuning. All alone, it probably won't give huge additions. Minification can likewise acquaint blunders that are hard with investigate.
How to Create
So, to create Javascript Minifier Tool on blogger you need to follow the following process below precisely.
What's more, with the help of these steps, you can easily make this tool in your blogger website.
Step 1
- You will go to your - Blogger Dashboard
- Go to Theme
- Go to - Edit HTML
- Search - </head> or </head>
- Copy this CSS Code below and Paste on top of </head> or </head>
- Save Theme
You must back up your theme before go to Edit HTML
<link rel='stylesheet' href='https://cdn.jsdelivr.net/gh/itsTSUI/tsP/toolBody.css'/>
<script crossorigin='anonymous' src='https://kit.fontawesome.com/4ad360bfd2.js'/>
Step 2
- After Save Theme
- Create a new Post or Page
- Copy this HTML & Javascript Code below and Paste in your blog - Post or Page
- Publish
<div class="Tbody">
<textarea rows="15" placeholder='Paste Your Javascript Code Here' id="js-minify-text"></textarea>
<div id="action-error"></div>
<button type="submit" id="js-minify-submit">Minify<i class="fa-regular fa-hand-point-right"></i></button>
<button id="copy-to-clipboard"><i class='fa-regular fa-copy'></i>Copy</button>
<button id="js-minify-submit-undo" class="undo"><i class='fa fa-undo'></i>Undo</button>
</div>
<script src='https://code.jquery.com/jquery-3.6.0.min.js'></script>
<script src='https://clipboardjs.com/dist/clipboard.min.js'></script>
<script src="https://www.browserling.com/js/tools/uglifyjs.js"></script>
<script>
function mkUndo(toolName){var undoSelector="#"+toolName+"-submit-undo",textSelector="#"+toolName+"-text";$(undoSelector).click(function(ev){ev.preventDefault();var last=undoStack.pop();$(textSelector).val(last)})}function mkTool(toolName,computeFn,opts){opts=opts||{};var submitSelector="#"+toolName+"-submit",undoSelector="#"+toolName+"-submit-undo",textSelector="#"+toolName+"-text";$(submitSelector).click(function(){var text=$(textSelector).val();if(opts.allowEmptyText||text.length){$("#action-error").hide();try{if(opts.asyncResultFn)computeFn(text,opts.asyncResultFn);else{var result=computeFn(text,opts.asyncResultFn);$(textSelector).val(result)}}catch(err){return void(opts.exceptionFn&&opts.exceptionFn(err))}undoStack.push(text),$(undoSelector).show()}}),mkUndo(toolName)}var undoStack=[];$(function(){mkTool("js-minify",function(r){var o=UglifyJS.parse(r);o.figure_out_scope();var i=UglifyJS.Compressor();o=o.transform(i);var n=o.print_to_string();return n},{exceptionFn:function(r){return r instanceof UglifyJS.JS_Parse_Error?($("#action-error").show(),void $("#action-error").text(r.message)):e.message?($("#action-error").show(),void $("#action-error").text("Failed compressing: "+r.message)):($("#action-error").show(),void $("#action-error").text("Something went wrong while minifying..."))}})}),$(function(){$("#copy-to-clipboard").click(function(ev){ev.preventDefault(),$("#js-minify-text").select(),document.execCommand("copy"),toastr.success("Your Text is successfully copied to clipboard")})})
</script>
Final Words
You ought to indeed note by thinking in the remark box underneath. Or on the other hand you moreover bear to give some sort of Suggestion, likewise you can partake your conviction with me in the Comment Box beneath.
I didn't give this content to any individual who saw or replicated them. This content I've looked through a great deal and given by experience. So kindly don't note on this substance.
Assuming you experience any issues while copying this script you can impart me by Telegram and I'll attempt to help.
Post a Comment