add .js file as source in html file from server

I have an HTML file on my server, and a Javascript file on the same server. I want it so that when I load the HTML file, it will the reference of .js file placed on the server.

I tried this way:

        <script type="text/javascript src="...server side path...."></script>

but it is not working. Can any one tell me how I can do this?! I attached the code

<html xmlns="" xmlns:form="" xml:lang="en">
<script type="text/javascript" src="~/FormFaces/formfaces.js"></script>
    <data xmlns="">

<table><tr><td><form:input ref="textbox1">
</td><td><form:input ref="textbox2">
</td></tr><tr><td><form:input ref="textbox3">

` I want the formfaces.js file to be included in my Text.html file. But when i run the text.html file through my local server in a browser, it doesnot load the formfaces.js file. IF i run that file manually , all works fine


Javascript files are read and executed on the client.

You need to use a client-side path; the browser will send an HTTP request to that URL.

Source: stackoverflow