I'm having a problem with the following function. It's rendering in the browser as [object Window] instead of the HTML content...
BTW, the eval(func_fix); is executing InsertMenu() correctly.
Any idea why?
Thank you in advance.
<script>
$(document).ready(function() {
$("#component").each(function() {
var func = $(this).attr("name");
var func_fix = func.replace(")",","+$(this).attr("data-pagenum")+")");
var content = eval(func_fix);
$(this).replaceWith("<div>" + content + "</div>");
});
});
function InsertMenu(param,pagenum) {
$.get("compmenustructure.asp",{pagenum: pagenum, stylemenunum: param})
.done(function(data) {
content = data;
});
return content;
}
</script>