External Javascript files localizationhttp://forums.asp.net/t/1763251.aspx/1?External+Javascript+files+localizationFri, 27 Jan 2012 15:49:29 -050017632514803741http://forums.asp.net/p/1763251/4803741.aspx/1?External+Javascript+files+localizationExternal Javascript files localization <p>I am localizing messages in Javascript code and I took the following approach posted by someone some time ago:</p> <p><pre class="prettyprint">&lt;script type = &quot;text/javascript&quot;&gt; function ShowGreetings() { var message = '&lt;%=GetGlobalResourceObject(&quot;Resource&quot;, &quot;Greetings&quot;) %&gt;'; alert(message); } &lt;/script&gt;</pre> </p> <p><span>This works fine if JavaScript code is inside the .aspx page but, what if such code is within a &quot;.js&quot; file and such a file is included in the .aspx page using &lt;script src=&quot;../Scripts/File.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/</span><wbr><span>script&gt; ???</span></p> <p><span>I have tried this approach in external &quot;.js&quot; files and it did not work when testing my web site in my development PC.</span></p> <p><span>I will very much appreciate any advice.</span></p> <p><span>Respectfully,<br> Jorge Maldonado&nbsp;</span></p> 2012-01-27T14:43:56-05:004803809http://forums.asp.net/p/1763251/4803809.aspx/1?Re+External+Javascript+files+localizationRe: External Javascript files localization <p><a href="http://www.west-wind.com/weblog/posts/2009/Apr/02/A-Localization-Handler-to-serve-ASPNET-Resources-to-JavaScript">http://www.west-wind.com/weblog/posts/2009/Apr/02/A-Localization-Handler-to-serve-ASPNET-Resources-to-JavaScript</a></p> <p>hope this helps...</p> 2012-01-27T15:49:29-05:00