EzDevInfo.com

minified.js

A lightweight library for the Web Minified.js - A Truly Lightweight JavaScript Library

Change the name of created minified file in maven

I created a minified file with default name 1.js.

How can I change the name of 1.js to snapshot.js?


Source: (StackOverflow)

Safe max line length for Minified javascript on Win7?

I am seeing following error on Win 7: 'line 1 col 26270 access is denied'

Is there any doc regarding what would be a good chars-per-line limit for minified javascrpt? I am currently using 50k and it looks like a bad idea for Windows. Also this JS file is from a page inside iframe, not sure if there's any special rules for iframe pages that don't apply to the host page.

This error is not happening on Windows 8 and OSX, only showing up for Win 7.


Source: (StackOverflow)

Advertisements

minified JS causing ie 11 memory to grow by 1MB on page refresh

I have an application.js file that has my minified javascript. on IE11, every time I refresh my page I see 1MB heap growth until it crashes the app eventually. If I don't minify my javascript then everything is fine and the heap size stays at 250k. I tried using ufligy2JS, google-closure and UI Compressor and this behavior is consistent across all minifying tools.

Any ideas on why my heap is growing only when my js is minified?


Source: (StackOverflow)

Repeat MinifiedJS function X times?

I am using the library at minifiedjs.com. Using that script, I have a div blinking twice:

vbox1.animate({$backgroundColor: 'grey'}, 100)
.then(function() { return vbox1.animate({$backgroundColor: 'transparent'}, 100) })
.then(function() { return vbox1.animate({$backgroundColor: 'grey'}, 100) })

As you can see, it simply sets the background to grey, back to transparent, and then back to grey again. The problem is, I want this div to blink X number of times.

I know I could do this by simply chaining more .then() animations; but that seems a bit repetitive. Anyone mind helping me out on cleaning this up?

vbox1.animate({$backgroundColor: 'grey'}, 100)
.then(function() { return vbox1.animate({$backgroundColor: 'transparent'}, 100) })
.then(function() { return vbox1.animate({$backgroundColor: 'grey'}, 100) })
.then(function() { return vbox1.animate({$backgroundColor: 'transparent'}, 100) })
.then(function() { return vbox1.animate({$backgroundColor: 'grey'}, 100) })
.then(function() { return vbox1.animate({$backgroundColor: 'transparent'}, 100) })
.then(function() { return vbox1.animate({$backgroundColor: 'grey'}, 100) })
.then(function() { return vbox1.animate({$backgroundColor: 'transparent'}, 100) })
.then(function() { return vbox1.animate({$backgroundColor: 'grey'}, 100) })
.then(function() { return vbox1.animate({$backgroundColor: 'transparent'}, 100) })
.then(function() { return vbox1.animate({$backgroundColor: 'grey'}, 100) })
.then(function() { return vbox1.animate({$backgroundColor: 'transparent'}, 100) })
.then(function() { return vbox1.animate({$backgroundColor: 'grey'}, 100) })
.then(function() { return vbox1.animate({$backgroundColor: 'transparent'}, 100) })
.then(function() { return vbox1.animate({$backgroundColor: 'grey'}, 100) })
.then(function() { return vbox1.animate({$backgroundColor: 'transparent'}, 100) })
.then(function() { return vbox1.animate({$backgroundColor: 'grey'}, 100) })
.then(function() { return vbox1.animate({$backgroundColor: 'transparent'}, 100) })
.then(function() { return vbox1.animate({$backgroundColor: 'grey'}, 100) })
.then(function() { return vbox1.animate({$backgroundColor: 'transparent'}, 100) })
.then(function() { return vbox1.animate({$backgroundColor: 'grey'}, 100) })

Source: (StackOverflow)

using squishit and rendering external minifiedjs at the end of body element

I have master page and child page in my aplication. At runtime i determine the js & css to be included in master page pre-init method and render the js & css using squish it (bundlecss.AsCached & bundlecss.Render) method. In master page Head control the file is included using Bundle.Css().RenderNamed method.

Now my requirement is to include the external js file at the end of body element to enable faster rendering of web page. When i called Bundle.Css().RenderNamed at the end of the body element, the js file is not included in the page.

Is it not possible to specify the location where the minified js should be included in page html when using squish framework ?

Thanks in advance. Brahmaiah


Source: (StackOverflow)

MinifiedJS $.request post FormData

I'm trying to make an AJAX file uploading using MinifiedJS and $.request.

I have and HTML file with an input file.

<input type="file" id="fileAvatar" />

And my Javascript code looks like this.

$('#fileAvatar').on('change', uploadAvatar);

function uploadAvatar(event) {
  var fData = new FormData();
  // Add files
  _.each(event.target.files, function(file, key) {
    fData.append(key, file);
  });
  // Add ohter parameters
  fData.append('user', 267345);

  // POST formData
  $.request(
    'post', 
    '/ajax/upload_avatar.php', 
    fData, 
    {'Content-Type': 'multipart/form-data'}
  ).then(function(response){
    console.log(response);
  });
}

I can see the POST to /ajax/upload_avatar.php on Chrome Dev tools, but i don't get any parameters on my PHP, it looks like the form data object is not sent.

Any thoughts?


Source: (StackOverflow)

Update text content with minified.js

What is the right way to update text of a element with minifiedjs?

E.g.

<a class="myRef">Old text</a>

I have tried logical:

$('.myRef').text('New text');

But it doesn't work.


Source: (StackOverflow)