Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Suppose your project's directory looks like:</p> <pre><code>/App_Code /App_Data /App_Themes /Master_Pages ... web.config </code></pre> <p>Add a folder called "scripts" so you have:</p> <pre><code>/App_Code /App_Data /App_Themes /Master_Pages /scripts ... web.config </code></pre> <p>Put your javascript file in this scripts folder.</p> <p>Put the script tag in any of your aspx pages.</p> <pre><code>&lt;script src="/ProjectRoot/scripts/your-file.js" type="text/javascript"&gt;&lt;/script&gt; </code></pre> <p>The key to remember is the path you specify in the src attribute. This is relative to the root of your domain. If you are developing on your machine and you test your project at: <a href="http://localhost:2430/SomeProject/" rel="nofollow noreferrer">http://localhost:2430/SomeProject/</a></p> <p>Then your script tag needs to look like:</p> <pre><code>&lt;script src="/SomeProject/scripts/your-file.js" type="text/javascript"&gt;&lt;/script&gt; </code></pre> <p>If your project is deployed on a server at the root: <a href="http://www.example.com/" rel="nofollow noreferrer">http://www.example.com/</a></p> <p>Then your script tag needs to look like:</p> <pre><code>&lt;script src="/scripts/your-file.js" type="text/javascript"&gt;&lt;/script&gt; </code></pre> <p>If your project is deployed on a server at the root: <a href="http://www.example.com/SomeApp" rel="nofollow noreferrer">http://www.example.com/SomeApp</a></p> <p>Then your script tag needs to look like:</p> <pre><code>&lt;script src="/SomeApp/scripts/your-file.js" type="text/javascript"&gt;&lt;/script&gt; </code></pre> <p>FYI, because the script tag is not a server-side tag you can't use the "~/" syntax. And because you can't use the "~/" syntax, you (usually) can't use a relative path for the src attribute but instead have to specify an absolute path from the root of your domain.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload