Link to home
Start Free TrialLog in
Avatar of sherbug1015
sherbug1015Flag for United States of America

asked on

Jquery - Reading from a Div

We are building a chat engine and when the user clicks on the chat link a popup appears that has a list of the user's latest chats.  This list is being returned through a webservice call inside a string builder that contains all the html.  See attached screen grab (chathtml).

I am tryng to read the data-roomid attribute for whatever chat the user clicks on.  (see attached screen grab chatusers)

I am only able to read the first data-roomid.    Here is the relevant jQuery

$.ajax({
      type: "POST",
        url: "/CMSPages/WebService.asmx/GetMyLatestChats",
        data: {},
       success: function (data) {
          var encodedHtml = data.children[0].innerHTML;
          var decodedHtml = decode(encodedHtml);
          alert(decodedHtml);
          var windowRoomId = $('.chatListWrapper').data('roomid');
       
          $("#frame").addClass("active");
       
        $("#frame").attr("src", "http://172.16.16.31/CMSModules/Chat/CMSPages/ChatRoomWindow.aspx?windowroomid=" + windowRoomId + "&popupSettingsId=" + popupSettingsId);

Does anyone know of anyway I can get the roomid of the chat the user clicked on
chathtml.jpg
chatusers.jpg
ASKER CERTIFIED SOLUTION
Avatar of Alexandre Simões
Alexandre Simões
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sherbug1015

ASKER

Thanks.