• b0rman

    (@b0rman)


    Hi!

    Is there any possibility to fix Minify JS Line break removal. Seems like line break removal isn’t correct in some cases. For example:

    <script>
    function getCookie(name) {
    	var cookie = " " + document.cookie;
    	var search = " " + name + "=";
    	var setStr = "";
    	var offset = 0;
    	var end = 0;
    	if (cookie.length > 0) {
    		offset = cookie.indexOf(search);
    		if (offset != -1) {
    			offset += search.length;
    			end = cookie.indexOf(";", offset)
    			if (end == -1) {
    				end = cookie.length;
    			}
    			setStr = unescape(cookie.substring(offset, end));
    		}
    	}
    	return(setStr);
    } 
    
    function showcopyright(){
    if (!getCookie('copyright'))
      { alert('CopyRight Alert');
        document.cookie = "copyright=1";
      }
    }
    </script>

    isn’t working after Minify JS Line break removal but OK when just minified

Viewing 1 replies (of 1 total)
  • Frederick Townes

    (@fredericktownes)

    Seems the issue is that there’s a forgotten ; on this line: end = cookie.indexOf(";", offset) ?

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: W3 Total Cache] Minify JS Line break removal’ is closed to new replies.