I have a function inside a document ready:
$(document).ready(function () {
function test1() {
alert('successful');
}
});
Now in the Code behind (C#) I have this:
ScriptManager.RegisterStartupScript(this, typeof(Page),"Con121", "test1();", true);
This does not popup with an alert... But works fine if I take it out of the ready function. I need this to work in the ready.
I have even tried doing this with no success:
$(document).ready(function () {
window.test1 function test1() {
alert('successful');
}
});
need this to work in the ready- please can you elaborate on this statement to explain why you have to do it this way?