I am attempting to display data on a mouse hover event using a jQuery tooltip. The data I have looks like this:
{"description":"marry christmas","date":"2016-12-25
}" which I received from the server as a JSON string. I am parsing it in my calendar as follows:
holi is the variable holding the JSON string above
this is my import
<link href = "https://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel = "stylesheet">
<script src = "https://code.jquery.com/jquery-1.10.2.js"></script>
<script src = "https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
$.each(JSON.parse(holi), function(i, item) {
var holidayDate=item.date+"";
var parts= holidayDate.split("-");
alert("parts:"+parts[2]);
document.getElementById(parts[2]+parts[1]).style.color="green";
var va= document.getElementById(parts[2]+parts[1]).innerHTML;
document.getElementById(parts[2]+parts[1]).innerHTML="<label id="+parts[2]+parts[1]+" title="+
item.description+">"+va+"</label>";
$("#"+parts[2]+parts[1]).tooltip();
});
}
Now when I hover over 25th December, it only shows "marry" instead of "merry Christmas." I tested this in Chrome. Can someone please help me identify what's wrong with this setup?