0
public class JavaScriptHelper
{
public HelperResult Minify(Func<HelperResult> code)
{
return new HelperResult(writer => writer.Write(JavaScriptCompressor.Compress(code().ToString())));
}
}
@section Script
{
@JavaScriptHelper.Minify(
@<script>
(function ($, b) {
$(function() {
$("#upload").bind("submit", function (e) {
e.preventDefault();
console.log("going");
$(this).ajaxSubmit(function (result) {
if (!b.ajaxFailure(result, true)) {
console.log(result);
}
});
});
});
})(jQuery, b);
</script>)
}
我希望我添加的標籤是正確的。如果沒有,請將它們改回。 – CodesInChaos 2012-02-18 23:46:43