XModPro

jQuery Guru Assistance needed

Jeff M. Jeff M. asked Sep 17, 2014
Active Sep 17 · Viewed 1256 times
<p>Hello..</p><p>I have a template which has DIV's in it which are populated by a feed.&nbsp;</p><p>Items such as a DisasterID and the logged in user are used for the feed to display messages to the user for that particular disaster. &nbsp;Multiple disasters (and the particular users messages) can be displayed within this template. &nbsp;This works great.</p><p>My question is this; I'd like to hide the div's be default. &nbsp;Yet if the feed returns information, I'd like the div unhidden and it's information within displayed.</p><p>What would I do to accomplish this?</p><p>Thanks..</p><p>&lt;div id="RRMessageDIV_[[DisasterID]]" c-l-a-s-s="RRMessages" style="display:none;"&gt;</p><p> &lt;hr c-l-a-s-s="style-two"&gt;</p><p> &lt;span c-l-a-s-s="rr_id" style="display:none;"&gt;[[disasterID]]&lt;/span&gt;</p><p> &lt;span c-l-a-s-s="user_name" style="display:none;"&gt;[[User:DisplayName]]&lt;/span&gt;</p><p>&lt;/div&gt;</p><p>&lt;xmod:jQueryReady&gt;</p><p> $.each($('.RRMessages'), function(index, value) { </p><p> var RRID = parseInt($(this).find('.rr_id').text());</p><p> var U-s-e-r = $(this).find('.user_name').text();</p><p> $.ajax({</p><p> url: '/DesktopModules/XModPro/Feed.aspx?pid=' + _portalId + '&xfd=Feed_HomePageReplyRequiredMessage', </p><p> type: "POST", </p><p> dataType: "html", </p><p> data: { </p><p> "DisasterID" : RRID, </p><p> "UserName" : U-s-e-r</p><p> }, </p><p> success: function(data) { </p><p> // If information is returned; display div and the information.</p><p>// Otherwise keep hidden</p><p>// $('#RRMessageDIV_'+RRID). // ???????? - Turn off display:none</p><p> $('#RRMessageDIV_'+RRID).html(data);</p><p> } </p><p> });</p><p> });</p><p>&lt;/xmod:jQueryReady&gt;</p></p>

1 Answer

Loading answers...