how to debug after r.js building the project: optimize: 'none',
//Introduced in 2.0.2: a bit experimental.
//Each script in the build bundle will be turned into
//a JavaScript string with a //# sourceURL comment, and then wrapped in an
//eval call. This allows some browsers to see each evaled script as a
//separate script in the script debugger even though they are all combined
//in the same file. Some important limitations:
//1) Do not use in IE if conditional comments are turned on, it will cause
//errors:
//http://en.wikipedia.org/wiki/Conditional_comment#Conditional_comments_in_JScript
//2) It is only useful in optimize: 'none' scenarios. The goal is to allow
//easier built bundle debugging, which goes against minification desires.
useSourceUrl: true,
how to clear a file upload input function resetFormElement(e) {
e.wrap('').closest('form').get(0).reset();
e.unwrap();
}
or var control = $("#control");
$("#clear").on("click", function () {
control.replaceWith( control = control.clone( true ) );
});
From stack overflow
Unlike innerText, though, innerHTML lets you work with HTML rich text and doesn’t automatically encode and decode text. In other words, innerText retrieves and sets the content of the tag as plain text, whereas innerHTML retrieves and sets the same content but in HTML format.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
!important
copy reference or value, deep copy
in the _.each(list, function(element, index){}), the element is a copy of the list[index], but the keys inside element are passed by reference.