I am adding the following code to an Unfiltered HTML widget to see if I can get this to work on our Telligent site. However, when I save the widget, all of the "+" signs disappear from the javascript code. Has anyone seen this before or know of a workaround?
Thanks,
Terry McMillan
PDI
Code:
<style>
#calendar li
{
margin-bottom: 12px;
}
#calendar li p
{
line-height: 14px;
margin-bottom: 5px;
}
.calendar
{
font-size: 11px;
margin-left: 10px;
}
</style>
<div>
<ul id="calendar">
</ul>
</div>
<script type="text/javascript">
$(document).ready(function()
{
$.ajax({
type: "GET",
url: "calendar.xml",
dataType: "xml",
success: manipulateXml
});
});
var _calendarItemCount = 0;
function manipulateXml(data)
{
//find every event and list the details
$(data).find("event").each(function() {
if (_calendarItemCount >= 5)
return;
var title = $(this).find("title").text();
var dates = $(this).find("dates").text();
var location = $(this).find("location").text();
var expires = new Date($(this).find("expires").text());
var output = "";
var today = new Date();
var display = new Date();
display.setDate(display.getDate() + 75);
if (today <= expires && expires <= display) {
output = "<li>";
output += "<p><strong>" + title + "</strong></p>";
output += "<p class='calendar'>" + dates + "</p>";
output += "<p class='calendar'>" + location + "</p>";
output += "</li>";
$("#calendar").append(output);
_calendarItemCount++;
}
});
}
</script>