Friday, December 26, 2014

Is it possible to handle conflicts between 2 versions of jQuery loaded in the same page?

Question: Is it possible to handle conflicts between 2 versions of jQuery loaded in the same page?

Answer:  Using jQuery.noConflict, you can make multiple versions of jQuery coexist on the same page.
<!-- load jQuery 1.1.3 -->
<script type="text/javascript" src="http://example.com/jquery-1.1.3.js"></script>
<script type="text/javascript">
var jQuery_1_1_3 = $.noConflict(true);
</script>

<!-- load jQuery 1.3.2 -->
<script type="text/javascript" src="http://example.com/jquery-1.3.2.js"></script>
<script type="text/javascript">
var jQuery_1_3_2 = $.noConflict(true);
</script>
Then, instead of $('#selector').function();, you'd do jQuery_1_3_2('#selector').function(); or jQuery_1_1_3('#selector').function();.

Thursday, December 18, 2014

Why the space is not freed on UNIX after a file is deleted?

Question: When a large file is deleted from a UNIX file system why is the free space not changing?

Answer: One possibility is that the file being deleted have more references in the filesystem, such as it is still open by a user, in this case the space will be freed after the file is closed.