Ok,i know in Php you can use include for a Php file…for example…
include("array.php");
Is there a way to do this in Javascript and Jsp?
From what i read i cant use for example include("array.javascript"); or include("array.jsp");
I want to load the array from a different file and i know how to do it with Php,but not with Javascript or Jsp. Any help?
I think you are a bit confused, JSP is an XML-based language executed at the server side that gets transformed into Java the first time is processed by the servlet container (server) whilst JavaScript is an interpreted language executed by the user’s browser, not the server. PHP is also executed at the server-side and that
includefunction has nothing to do with JavaScript.Now, to port that behaviour to JSP you would use a JSP tag, more specifically, the
<jsp:include />tag:But if what you are trying to is to link your JSP with a JavaScript file then you should use a better option which consist of using the standard HTML
<script>tag: