Question

Sudheer Madduru on Fri, 07 Apr 2017 11:10:40


Hi,

We have my HTML, that I have added in the master page.

Once after clicking on Start Chat, we are making an ajax call  with some parameters and third party is giving the chat window url with Token id.We are displaying that URL in iframe.

Now when we are  going to different page, chat is getting stopped.But we want to open this chat as it is. 

The vendor who is providing this chat conveyed that this HTML should not load on page load.Then only this chat is going to continue.

<o:p>Please share your inputs on this.</o:p>

<o:p>Regards,</o:p>

<o:p>Sudheer </o:p>

<o:p></o:p>



Thanks & Regards, Sudheer


Sponsored



Replies

Amit.AK.Kumar on Fri, 07 Apr 2017 11:40:03


Hi Sudheer,

You can write, one function in javascript/JQuery which would be called on document.ready when IFRAME (with id), embedded on your master page loaded then assign url to IFRAME. You can check using set/clear interval that IFRAME with id loaded or not then set the url:

//--Add JQuery reference first
//*****************Document.Ready**************::Start******************
$(document).ready(function () {
 //--Suppose this is DOM element of header
var chkHeaderLoaded = setInterval(function () {
    //----If total number of processed items equal to unique items on the screen
    if ( $('#<IFRAMEID>').length >0) {
        //--To do
        clearInterval(chkHeaderLoaded);
    }
}, 300);
});
//*****************Document.Ready**************::End******************