html - Placing of a JavaScript resource file -
i have html file use angularjs javascript file. , run application using tomcat 7
<html> <head> <script src="src/main/resources/appjs/angular.min.js"></script> // not working <script src="/resources/appjs/angular.min.js"></script> // not working <script src="/src/main/resources/appjs/angular.min.js"></script> // not working <!-- <script src="angular.min.js"></script> --> // working </head> <body> <h2>hello world!</h2> <div ng-app=""> <p>name : <input type="text" ng-model="name"></p> <h1>hello {{name}}</h1> </div> </body> </html>
if put js file in separate folder wont work. , if put inside same directory work. reason behavior ?
when giving relative paths out '/' in beginning start looking file relative folder html present. in case there angular.min.js index.html located works other doesn't.
Comments
Post a Comment