How can i decrease a 300 character Javascript File to 50 character with no code losing

chippox

Newbie
Joined
Jun 13, 2018
Messages
40
Reaction score
9
How can i decrease a 300 character Javascript File to 50 character with no effect lose ?
 
Hey there,
It'd be a hard thing to tell because It all depends on your JavaScript source:
  1. Take a look at online JavaScript minifiers.
  2. Shorten variable names, remove empty lines and characters.
  3. If it contains a library in it, move the library to another file (maybe call it as vendor.js) and load it using another script tag:
    It helps browser to cache libraries (like jQuery) which I don't think you'd upgrade it every day.
  4. (I don't completely remember this so use it and answer if it doesn't work) Use eval and hex representation of your script.
 
Try to minify your js file. Search for "minify javascript online"
 
Hey there,
It'd be a hard thing to tell because It all depends on your JavaScript source:
  1. Take a look at online JavaScript minifiers.
  2. Shorten variable names, remove empty lines and characters.
  3. If it contains a library in it, move the library to another file (maybe call it as vendor.js) and load it using another script tag:
    It helps browser to cache libraries (like jQuery) which I don't think you'd upgrade it every day.
  4. (I don't completely remember this so use it and answer if it doesn't work) Use eval and hex representation of your script.
Javascript minifiers did work thank you . i solved my problem
Try to minify your js file. Search for "minify javascript online"
Javascript minifiers did work thank you . i solved my problem
 
Back
Top