[jQuery] setInterval not working as i expect it to

[jQuery] setInterval not working as i expect it to


i'm not sure why this doesn't work ... i'm probably missing some
really important 'big picture' understanding of JS and jQuery, but
here goes ...
This code will trigger my alert every 3 seconds if placed outside $
(document).ready ... but if it's inside it, it fails.
OK, this works ...
function alertMe() {
alert("Testing 123!");
};
function intervalTrigger() {
setInterval("alertMe()", 3000);
};
intervalTrigger();
$(document).ready(function() {
});
this fails ...
$(document).ready(function() {
function alertMe() {
alert("Testing 123!");
};
function intervalTrigger() {
setInterval("alertMe()", 3000);
};
intervalTrigger();
});