Question

2
Replies
36
Views
bajrang Member since 2015 6 posts
Tech Mahindra
Posted: 2 weeks 2 days ago
Last activity: 1 week 6 days ago

Converting Web chat Mashup into iframe tag style

I have converted web chat mashup into irame tag as given below . initially, it gives authentication error in chrome but loads webchat within seconds properly .But in  browser console it gives errors "Cannot read property '_bIsIframeOnly' of undefined".

What is best practice for generating webchat channel in iframe style.

below is the sample code:-

.................................................................................................

Webchat channel  mashup code generated by pega .................................................................................................

<script src ='https://example.com/prweb/app/Appname/?pyActivity=pzIncludeMashupScripts'></script&gt; <div    class="display:block;width: 500px;height:700px;"   data-pega-gadgetname ="PegaGadget"  data-pega-action ="createNewWork" data-pega-action-param-classname ="Work-Channel-Chat" data-pega-action-param-flowname ="pyStartCase" data-pega-isdeferloaded ="false" data-pega-applicationname ="Appname" data-pega-threadname ="STANDARD" data-pega-resizetype ="fixed" data-pega-url ="https://example.com/prweb/PRChat/app/Appname/" data-pega-action-param-parameters ='{"channelId":"botid1234"}' >

-------------------------------------------------------------------------------------------------------------------------------------- iframe style code (this code loads chat on click of button , but gives error in chrome browser console) ................................................................................................................................................................. <script src ='https://example.com/prweb/app/Appname/?pyActivity=pzIncludeMashupScripts'></script&gt;

<script> function loadGadget() { 

var myIframe=document.getElementById("PegaGadgetIfr"); myIframe.src=myIframe.src+"&channelId=botid1234"; myIframe.style.display = "block"; pega.web.api.doAction(myIframe, "load");  }

 </script>   <iframe name="PegaGadgetIfr" id="PegaGadgetIfr"  class= "display: none;width: 500px;height:700px;" data-pega-iframe-gadgetname ='PegaGadget' data-pega-resizetype ='fixed'   src="https://example.com/prweb/PRChat/app/Appname/!STANDARD?pyActivity=@baseclass.doUIAction&action=createNewWork&isWebMashup=true&sendP3P=y&className=Work-Channel-Chat&flowName=pyStartCase" border="0" frameborder="0"></iframe>  <button onclick="loadGadget()"> load mashup</button>  

Pega Platform 8.4.2 Conversational Channels Other Industry Decisioning Consultant
Share this page LinkedIn