How to call external js file from jQuery on page load
<p>I have partial view for rating. This view is repeated multiple time on a single page.
I have written the functional code for rating in an external js file.
Now I want to call that js file each time rating view is loaded.
Also I want to pass parameter to the external js file.
I have tried the following method to do this:</p>

<pre><code>&lt;script type="text/javascript" &gt;
  var EntityId="@ViewData["entityid"]";// parameters which i want to pass
  var RatingValue="@ViewData["rating"]";// parameters which i want to pass
  var EntityName="@ViewData["entityname"]";// parameters which i want to pass
&lt;/script&gt;

&lt;script type="text/javascript" src="../../Scripts/RatingControl.js"&gt;&lt;/script&gt;
</code></pre>

<p>The code above is working but the external script only access last value of passed variable
e.g. there is 5 records on my page then the rating control will be added 5 time with different value. But in external file I only get last records rating value.</p>

<p>So how can I call external js file from javascript code on each partial view load event.</p>
