function convertDateFormat(){
// alert("hi");
$(".tour-dates ul li").each(function(){
// alert(monthConvert($(this).find(".month").text()));
var replace = monthConvert($(this).find(".month").text());
$(this).find(".month").text(replace);
});
}
I have the above function in a js file and i’m calling it from $(document).ready(function(){...
you can see i have two alert statements that are commented.
if they are commented the function doesn’t seem to be called because the changes aren’t reflected.
If i remove the comment and let the alert work, the changes appear!
What am I doing wrong?
FYI:
The monthConvert function:
function monthConvert(monthInt){
var monthArray = new Array();
monthArray["1"]="JAN";
monthArray["2"]="FEB";
monthArray["3"]="MAR";
monthArray["4"]="APR";
monthArray["5"]="MAY";
monthArray["6"]="JUN";
monthArray["7"]="JUL";
monthArray["8"]="AUG";
monthArray["9"]="SEP";
monthArray["10"]="OCT";
monthArray["11"]="NOV";
monthArray["12"]="DEC";
return monthArray[monthInt];
}
Perhaps you could check your browsers JavaScript logs for errors.
In Internet Explorer 9 press F12
In Firefox download firebug.
In Chrome press CTRL + SHIFT + J