I am pretty new in JavaScript and I have the following doubt.
Into a JSP page I include a .js file that contains a function definition, in this way:
<script src="<c:url value="resources/js/userAgentInfo.js" />"></script>
Into this userAgentInfo.js file I have define a function, something like this:
function exludeUserAgent() {
...............................................
...............................................
...............................................
if (browserName === "Microsoft Internet Explorer" && majorVersion <= 10) {
alert("EXCLUDE");
return true;
}
return false;
}
OK, now my problem is: how can I call and perform this exludeUserAgent() function into my page? I have included the file that contain its definition but now I want to perform it when the page is loaded.
window.onload = exludeUserAgent;