So there I am trying to load an external .js file which in return loads other pages using $.ajax and jQuery Templates. Everything was working when my code was all in a single .aspx page. But after distributing everything to separate clean files I am having this error:
Default.aspx
<asp:ScriptManagerProxy ID="ScriptManagerProxy" runat="server">
<Scripts>
<asp:ScriptReference Path="~/Scripts/jquery-1.7.min.js" />
<asp:ScriptReference Path="~/Scripts/jQuery.tmpl.min.js" />
<asp:ScriptReference Path="~/Pages/Templates/Stream/Stream.js" />
</Scripts>
</asp:ScriptManagerProxy>
Stream.js
GetStream();
function GetStream() {
alert('ok');
$.ajax({ /* It reaches this line */
type: 'POST',
But returns the following.
$ is undefined
Please note that I have added the Stream.js file seperately without using the ScriptManagerProxy below the jquery-1.7 file. And still got the same thing. Ideas?
I forgot to mention that the content of Stream.js is wrapped in:
$(document).ready(function () { });