Javascript issue with Unfiltered HTML widget

Javascript issue with Unfiltered HTML widget

This question has suggested answer(s)

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>

All Replies
  • I had this same issue with an early build of Telligent Community 7.1

    my version that had the bug was: 7.1.0.29784

    after I applied a hotfix (7.1.2.30501) the issue was resolved and I stopped losing the + char in my javascript

  • Thanks for the suggestion David. Unfortunately, we are on version 6.1.9.30500, which is the latest hotfix for 6.1. We haven't had a compelling reason yet to upgrade to 7.1. I will try to find out if that issue was addressed in the latest 6.1 hotfix. If not, the bug renders the unfiltered html widget somewhat useless.

    Thanks for the help!