Hi I was trying to open a window where in i can do a process inside the opened windows using ajax. but my scripts doesn't work at all.
Here's my script so far on my main window
$('.tracker-window').on("click", function() {
var newWindow = window.open("/etrcontroller", "_blank", "toolbar=yes,top=500,left=900,width=400,height=400");
});
And my code in my opened window
<script>
$(function () { alert(); });
</script>
when I opened the window using the first script it opens up but it does not alert.
Can I ask for some help.
Thanks.
first make sure you added jquery
Try your code inside $( document ).ready()
for example
$( document ).ready(function() {
$('.tracker-window').on("click", function() {
var newWindow = window.open("/etrcontroller", "_blank", "toolbar=yes,top=500,left=900,width=400,height=400");
});
});
and
$( document ).ready(function() {
alert('hello world');
});