4 Replies Latest reply on Sep 12, 2006 6:31 AM by shane.bryzak

    Getting Conversation Id in javascript. Is there a better way

      Is there e better way to get conversation ID ?
      I need it for remoting calls

      var conversationId = -1;
      
      window.onload=function()
      {
      }
      
      /* Check conversation id */
      function checkConversation()
      {
       if ( conversationId == null || conversationId == -1 )
       {
       span = document.getElementById( "conversationIdSpan" );
       if ( span == null ) return;
       obj = span.childNodes[0];
       if ( obj == null ) return;
       obj = obj.childNodes[0];
       if ( obj == null ) return;
       conversationId = obj.nodeValue;
       }
      }
      


      <div class="Hidden">
       <span id="conversationIdSpan">
       <h:outputText value="#{conversation.id}" id="conversationIdHidden"/>
       </span>
      </div>