I have web pages generated by JSP which sometimes also include jQuery code. Some of the AJAX calls within jQuery need parameters from JSP. Example:
$.ajax({
url: "<%=ivy.html.startref("API/regions.ivp")%>",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(data) {
$.each(data.regions, function() {
$("#regions").append(
$("<option></option>").val(this.imPersonalNumber).html(this.cn + " [" + this.imJobTitleDescription + "]")
)
});
$("#regions").val($("#tempRegions").val())
}
})
Is there any way I can minify this kind of code?
I recommend that you replace the JSP content with some string of your choice, the use YUI Compressor for example, and after the compression you can replace that string with the original JSP content.