facebook

Reading external Javascript File in JSF

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #264492 Reply

    pmohanan
    Member

    Hi…,

    I removed all the JavaScript code & put it in a file called abc.js from a JSF page. Now I tried to refer it in the JSF page like this :

    <script src=”abc.js” type=”text/javascript”>
    </script>

    It gives me “Object Expected” error. Where should the abc.js reside in the Web Project.

    Regards,

    Praveen

    #264551 Reply

    Greg
    Member

    The abc.js will need to be relative to your currently loaded page. However, you could set the src=”” attribute to “/YourWebContextRootName/abc.js”. Then place the abc.js in the root of the WebRoot folder in MyEclipse.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Reading external Javascript File in JSF

You must be logged in to post in the forum log in