title: javascript in classic asp script block within script block error
body: <p>I'm trying to add the following </p>
  
  <pre><code>&lt;div class="pubble-app PQAQ_section" data-app-id="43522"&gt;&lt;/div&gt;
  &lt;script src="https://cdn.pubble.io/javascript/loader.js" defer&gt;&lt;/script&gt;
  </code></pre>
  
  <p>I'm using classic asp. But the error I keep getting is "A script block cannot be placed inside another script block." I tried the document.write technique found here: <a href="https://stackoverflow.com/questions/17108765/javascript-code-in-classic-asp">Javascript code in classic asp</a>, but no go.</p>
  
  <p>The loader.js code:</p>
  
  <pre><code>    var pbsafaridialogWindow,safariwindow_poll,ttt,initModuleTest;var pubbleLoader={};var pbldv="170828001";if(!String.prototype.trim){String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"")}}if(!String.prototype.len){String.prototype.len=function(){return this.trim().replace(/[^\x00-\xff]/g,"**").length}}if(!String.prototype.startsWith){String.prototype.startsWith=function(substring){var reg=new RegExp("^"+substring);return reg.test(this)}}if(!String.prototype.replaceAll){String.prototype.replaceAll=function(reallyDo,replaceWith,ignoreCase){if(!RegExp.prototype.isPrototypeOf(reallyDo)){return this.replace(new RegExp(reallyDo,(ignoreCase?"gi":"g")),replaceWith)}else{return this.replace(reallyDo,replaceWith)}}}if(typeof(window.pubbleLoader_init)==="undefined"){var pubbleLoader=(function(args){if(typeof(args)!=="undefined"){alert("args");initModule.loadConfig(args)}var initModule={removeParameter:function(url,parameter){var urlparts=url.split("?");if(urlparts.length&gt;=2){var urlBase=urlparts.shift();var queryString=urlparts.join("?");var prefix=encodeURIComponent(parameter)+"=";var pars=queryString.split(/[&amp;;]/g);for(var i=pars.length;i--&gt;0;){if(pars[i].lastIndexOf(prefix,0)!==-1){pars.splice(i,1)}}url=urlBase+"?"+pars.join("&amp;")}return url},filterPubbleParas:function(url){url=this.removeParameter(url,"PPMID");url=this.removeParameter(url,"PPMID");url=this.removeParameter(url,"visitor");url=this.removeParameter(url,"PPBUID");url=this.removeParameter(url,"PPBLINK");url=this.removeParameter(url,"myenquiry");url=this.removeParameter(url,"PPBUT");url=this.removeParameter(url,"PPBCID");url=url.replace("#myenquiry","");url=url.replace(/\?\s*$/,"");return url},initParams:function(){var data={callback:"pubbleLoader.initLoader"};for(var v in pubbleLoader.init){if(pubbleLoader.init.hasOwnProperty(v)){switch(v){default:if(typeof pubbleLoader.init[v]!=="undefined"&amp;&amp;pubbleLoader.init[v]!==null){data[v]=pubbleLoader.init[v]}break}}}initModule.initParams=function(){return data};return data},encode:function(a){return escape(this._utf8_encode(a))},decode:function(a){return this._utf8_decode(unescape(a))},_utf8_encode:function(b){b=b.replace(/\r\n/g,"\n");var a="";for(var e=0;e&lt;b.length;e++){var d=b.charCodeAt(e);if(d&lt;128){a+=String.fromCharCode(d)}else{if((d&gt;127)&amp;&amp;(d&lt;2048)){a+=String.fromCharCode((d&gt;&gt;6)|192);a+=String.fromCharCode((d&amp;63)|128)}else{a+=String.fromCharCode((d&gt;&gt;12)|224);a+=String.fromCharCode(((d&gt;&gt;6)&amp;63)|128);a+=String.fromCharCode((d&amp;63)|128)}}}return a},_utf8_decode:function(a){var b="";var d=0;var e=c1=c2=0;while(d&lt;a.length){e=a.charCodeAt(d);if(e&lt;128){b+=String.fromCharCode(e);d++}else{if((e&gt;191)&amp;&amp;(e&lt;224)){c2=a.charCodeAt(d+1);b+=String.fromCharCode(((e&amp;31)&lt;&lt;6)|(c2&amp;63));d+=2}else{c2=a.charCodeAt(d+1);c3=a.charCodeAt(d+2);b+=String.fromCharCode(((e&amp;15)&lt;&lt;12)|((c2&amp;63)&lt;&lt;6)|(c3&amp;63));d+=3}}}return b}};initModule.checkSafariWindow=function(){try{if(pbsafaridialogWindow!=null&amp;&amp;pbsafaridialogWindow.closed){pbsafaridialogWindow=null;clearInterval(safariwindow_poll);var initPath=pubbleLoader.servers.actionDomain+"/api/init.htm";DynamicLoadScriptQueue.AddTask(initPath+"?v="+new Date().getTime()+"&amp;"+pubbleLoader.utils.String.toParams(initModule.initParams()),"UTF-8")}}catch(exception){}},initModule.init=function(divs){for(var i=0;i&lt;divs.length;i++){var div=divs[i];var PBAppID=pubbleLoader.utils.getQueryString("PBAppID");var PBID=pubbleLoader.utils.getQueryString("PBID");if(PBAppID){div.setAttribute("data-app-id",PBAppID)}if(PBID){div.setAttribute("data-app-identifier",PBID)}var id=div.getAttribute("data-app-id");var identifier=div.getAttribute("data-app-identifier");var assignAppIds=div.getAttribute("assignAppIds");var assignAccountIds=div.getAttribute("assignAccountIds");var layout=div.getAttribute("data-app-layout");var token=div.getAttribute("data-app-token");var conver_id=div.getAttribute("data-app-conversation-id");var autho_info=div.getAttribute("data-app-auth_info");var signout=div.getAttribute("data-app-signout");if(!layout){layout="embed"}if(id=="37667"||id=="37631"){initModule.loadLink(pubbleLoader.servers.actionDomain+"/resources/LQA/css/LQA_style_skeleton.css");div.className+=" PQAT_skin_skeleton"}div.setAttribute("id","pubble_app_"+id);var initData={};if(assignAppIds){initData.assignAppIds=assignAppIds}if(assignAccountIds){initData.assignAccountIds=assignAccountIds}if(signout&amp;&amp;signout!==undefined){initData.signOut=signOut}if(autho_info&amp;&amp;auth_info!==undefined){initData.autho_info=auth_info}initData.appID=id;if(identifier!==undefined&amp;&amp;identifier!=null&amp;&amp;identifier!=""){initData.identifier=identifier}initData.layout=layout;initData.callback="pubbleLoader.initLoader";initData.url=initModule.encode(initModule.filterPubbleParas(window.location.href.split("#")[0]));if(token!=undefined&amp;&amp;token!=null){initData.userToken=encodeURIComponent(token);if(conver_id!=undefined&amp;&amp;conver_id!=null){initData.conversationId=conver_id}initData.is_conversation_app=1}var initPath=pubbleLoader.servers.actionDomain+"/api/init.htm";
  DynamicLoadScriptQueue.AddTask(initPath+"?v="+new Date().getTime()+"&amp;"+pubbleLoader.utils.String.toParams(initData),"UTF-8")}};initModule.loadScript=function(d,g){var f=document.getElementsByTagName("head")[0];if(!f){f=document.getElementsByTagName("body")[0]}var h,e,c=document.createElement("script");c.type="text/javascript";c.src=d;if(g){c.async=true}for(e=0;e&lt;f.childNodes.length;e++){if(f.childNodes[e].tagName=="link"){h=f.childNodes[e]}}if(!h){f.appendChild(c)}else{a.insertSiblingAfter(c,h)}};initModule.insertSiblingAfter=function(c,d){if(d.nextSibling===undefined){d.parentNode.appendChild(c)}else{d.parentNode.insertBefore(c,d.nextSibling)}},initModule.loadLink=function(c){var f=document.getElementsByTagName("head")[0],g,e,d=document.createElement("link");if(!f){f=document.getElementsByTagName("body")[0]}d.rel="stylesheet";d.type="text/css";d.href=c;d.data="pubble";d.media="all";var att=document.createAttribute("data");att.value="pb";d.setAttributeNode(att);for(e=0;e&lt;f.childNodes.length;e++){if(f.childNodes[e].tagName=="link"){g=f.childNodes[e]}}if(!g){f.appendChild(d)}else{f.appendChild(d)}};if(window.pubbleApp_config){pubbleLoader=function(pubbleApp_config){if(typeof(pubbleApp_config)!=="undefined"){initModule.nfig(pubbleApp_config)}initModule.init();return pubbleLoader}}else{var divs=getElementsByClassName("pubble-app");pubbleLoader=function(args){initModule.init(divs);return pubbleLoader}}pubbleLoader.inject=function(src,type){type=type||"js";if(type=="js"){var s=document.createElement("script");c;s.type="text/javascript";s.async=true;s.src=src}else{if(type=="css"){var s=document.createElement("link");s.type="text/css";s.rel="stylesheet";s.href=src}}(document.getElementsByTagName("body")[0]).appendChild(s)};pubbleLoader.onInitialize=[];pubbleLoader.init={};pubbleLoader.config={};pubbleLoader.data={};pubbleLoader.libs=[];pubbleLoader.apps=[];pubbleLoader.servers={web:"",actionDomain:"http://www.pubble.io",mediaDomain:"http://media.pubble.io",cdnDomain:"https://d2dfzm19238yrf.cloudfront.net"};pubbleLoader.servers.actionDomain=("https:"==document.location.protocol)?"https://www.pubble.io":"http://www.pubble.io";pubbleLoader.servers.mediaDomain=("https:"==document.location.protocol)?"https://media.pubble.io":"http://media.pubble.io";pubbleLoader.initLoader=function(c){if(c.status=="true"||c.code=="200"){var obj=document.getElementById("pubble_app_"+c.parameters.appId);var token=obj.getAttribute("data-app-token");if(c.appType=="qa"||c.appType=="BL"||c.appType=="LQ"){var locale=c.locale;var obj=document.getElementById("pubble_app_"+c.parameters.appId);var token=obj.getAttribute("data-app-token");var l2=obj.getAttribute("data-app-locale");if(l2!=undefined&amp;&amp;l2!=null){locale=l2}if(locale!=""&amp;&amp;locale!="en"){DynamicLoadScriptQueue.AddTask("https://www.pubble.io/resources/i18n/qa-"+locale+".js","utf-8")}}if(token!=undefined&amp;&amp;token!=null){initModule.loadLink("//www.pubble.io/resources/Pubble-App-CORE/css/pubble-core.css");var pusherLib=("https:"==document.location.protocol)?"https://js.pusher.com/2.2/pusher.min.js":"http://js.pusher.com/2.2/pusher.min.js";DynamicLoadScriptQueue.AddTask(pusherLib,"utf-8");var script_url=c.scriptURL;DynamicLoadScriptQueue.AddTask(script_url,"UTF-8");c.strings={};c.appType="qac";pubbleLoader.apps.push(c)}else{if(c.appType=="CN"){var script_url=c.scriptURL;var pusherLib=("https:"==document.location.protocol)?"https://js.pusher.com/2.2/pusher.min.js":"http://js.pusher.com/2.2/pusher.min.js";DynamicLoadScriptQueue.AddTask(pusherLib,"utf-8");DynamicLoadScriptQueue.AddTask(script_url,"UTF-8");initModule.loadLink("https://d5p15xwlzsa76.cloudfront.net/pubblebot/cw/css/pubble-cw.css");initModule.loadLink("https://d5p15xwlzsa76.cloudfront.net/pubblebot/cw/css/normalize.css");initModule.loadLink("https://d5p15xwlzsa76.cloudfront.net/pubblebot/sb/css/pubble-sb.css");pubbleLoader.apps.push(c)}else{if(c.appType=="qa"||c.appType=="BL"||c.appType=="LQ"){var obj=document.getElementById("pubble_app_"+c.parameters.appId);if(obj==null){return false}if(obj.offsetWidth&gt;600&amp;&amp;c.layout!=="modalbox"&amp;&amp;pubbleLoader.utils.checkMetaView()){c.showOnIpad=1}if(c.SSoenabled){c.showOnIpad=1}c.showPresense=1;if(c.scriptURL.indexOf("lib4")!==-1){c.qav3=true}else{c.qav3=false}if(c.scriptURL.indexOf("core")!==-1){c.qav4=true}else{c.qav4=false}var pURL=pubbleLoader.utils.getQueryString("PBURL");var PBID=pubbleLoader.utils.getQueryString("PBID");var PBLayout=pubbleLoader.utils.getQueryString("PBLayout");var PBAppID=pubbleLoader.utils.getQueryString("PBAppID");var PPMID=0;var reg=new RegExp("PPMID(\\d+)","i");if(reg.test(window.location.href)){PPMID=RegExp.$1}c.selfhost=0;if(pURL){c.pageURL=pURL;c.selfhost=1}if(PBID){c.identifier=PBID}else{if(c.page!=null&amp;&amp;c.page.identifier!==""){pubbleLoader.config.identifier=c.page.identifier;c.identifier=pubbleLoader.config.identifier}else{pubbleLoader.config.identifier=c.parameters.appId;c.identifier=pubbleLoader.config.identifier}}if(PBLayout){c.layout=PBLayout}if(PBAppID){c.appID=PBAppID
  }if(PPMID){c.PPMID=PPMID}var tmpl="";if(c.qav4){initModule.loadLink("//www.pubble.io/resources/Pubble-App-CORE/css/pubble-core.css");tmpl='&lt;div style="height:50px; width:100%;"&gt;&lt;div style="width:31px;height:31px;margin-top:9px;margin-left:50%;padding-left:-15px;"&gt;&lt;img src="//www.pubble.io/resources/Pubble-App-CORE/img/loading.gif" alt="Pubble loading" border="0" width="31" height="31"&gt;&lt;/div&gt;&lt;/div&gt;'}else{if(pubbleLoader.utils.isMobile()&amp;&amp;!c.showOnIpad){if(!pubbleLoader.utils.getQueryString("PBID")){if(!c.qav3){tmpl='&lt;div class="PQAQ_wrapper PQAQ_wrapper_color" id="pbwidgetcontainer"&gt;&lt;img style="width:31px !important; height:31px !important" id="loadingimg" '+'src="'+pubbleLoader.servers.cdnDomain+'/images/app/qa/loading31.gif"&gt;&lt;/div&gt;&lt;div id="PQAQ_customcss" '+'class="PQAQ_customcss"&gt;&lt;style&gt;.pb_highlight{opacity:0.5}&lt;/style&gt;&lt;/div&gt;&lt;div id="PQAQ_social" class="PQAQ_social"&gt;&lt;/div&gt;'+'&lt;div id="PQAQ_debug" class="PQAQ_debug"&gt;&lt;/div&gt;'}else{tmpl='&lt;div class="PQAQ_modal_all PQAQ_off"&gt;&lt;div class="PQAQ_modal"&gt;&lt;div class="PQAQ_modal_close"&gt;&lt;/div&gt; &lt;div class="PQAQ_modal_header"&gt;&lt;/div&gt;&lt;div class="PQAQ_modal_content"&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class="PQAQ_wrapper PQAQ_wrapper_color" id="pbwidgetcontainer"&gt;&lt;img style="width:31px !important; height:31px !important" id="loadingimg" '+'src="'+pubbleLoader.servers.cdnDomain+'/images/app/qa/loading31.gif"&gt;&lt;/div&gt;&lt;div id="PQAQ_customcss" '+'class="PQAQ_customcss"&gt;&lt;style&gt;.pb_highlight{opacity:0.5}&lt;/style&gt;&lt;/div&gt;&lt;div id="PQAQ_social" class="PQAQ_social"&gt;&lt;/div&gt;'+'&lt;div id="PQAQ_debug" class="PQAQ_debug"&gt;&lt;/div&gt;'}c.showPresense=0}else{if(!c.qav3){if(c.selfhost){tmpl+='&lt;div class="PQAX_holder PQAQ_hide scrollable" style="display:none"&gt;'}else{tmpl+='&lt;div class="PQAX_holder scrollable" style="display:none"&gt;'}c.showPresense=1;tmpl+='&lt;div class="PQAX_header"&gt;';tmpl+='   &lt;div class="PQAX_header_menu"&gt;';tmpl+='        &lt;a href="javascript:void(0);" class="PQAX_btn_u"&gt;&lt;/a&gt;';tmpl+='         &lt;a href="javascript:void(0);" class="PQAX_btn_i"&gt;&lt;/a&gt;';tmpl+='         &lt;a href="javascript:void(0);" class="PQAX_btn_x"&gt;&lt;/a&gt;';tmpl+="    &lt;/div&gt;";tmpl+="    ";tmpl+='    &lt;div class="PQAX_header_text"&gt;';tmpl+='           &lt;div class="PQAX_title"&gt;&lt;/div&gt;';tmpl+="     &lt;/div&gt;";tmpl+="     ";tmpl+="&lt;/div&gt;";tmpl+='&lt;div class="PQAX_user PQAQ_hide"&gt;';tmpl+='   &lt;div class="PQAX_photo"&gt; &lt;img/&gt; &lt;/div&gt;';tmpl+='    &lt;div class="PQAX_name"&gt;&lt;/div&gt;';tmpl+='    &lt;div class="PQAX_status"&gt;&lt;/div&gt;';tmpl+='    &lt;div class="PQAX_service"&gt;';tmpl+="        ";tmpl+="    &lt;/div&gt;";tmpl+='    &lt;div class="PQAX_btn_logout"&gt;&lt;/div&gt;';tmpl+='     &lt;div class="PQAX_btn_login PQAT_hide"&gt;&lt;/div&gt;';tmpl+='    &lt;!-- &lt;div class="PQAX_btn_close"&gt;&lt;/div&gt; --&gt;';tmpl+="&lt;/div&gt;";tmpl+='&lt;div class="PQAX_heart PQAQ_hide"&gt;';tmpl+='&lt;div class="PQAX_followers"&gt;&lt;span id="PQAX_follower_lists"&gt;&lt;ul id="PQAX_follower_lists_ul"&gt;&lt;/ul&gt;&lt;/span&gt;';tmpl+='             &lt;div class="PQAX_status_text"&gt;';tmpl+='                                    &lt;span id="PQAX_status_nrq"&gt;&lt;/span&gt;';tmpl+='                &lt;span id="PQAX_status_qtext"&gt;&lt;/span&gt;&lt;br /&gt;';tmpl+='                &lt;span id="PQAX_status_nrf"&gt;&lt;/span&gt;';tmpl+='                &lt;span id="PQAX_status_ftext"&gt;&lt;/span&gt;';tmpl+="              &lt;/div&gt;";tmpl+='        &lt;/div&gt;&lt;div class="PQAQ_clear" style="margin-bottom:5px"&gt;&lt;/div&gt;';tmpl+='&lt;div class="PQAX_moderators"&gt;&lt;span id="PQAX_mod_lists"&gt;&lt;/span&gt;&lt;div class="PQAX_moderators_text"&gt;&lt;/div&gt;';tmpl+='           &lt;!-- &lt;div class="PQAX_btn_close"&gt;HIDE&lt;/div&gt; --&gt;';tmpl+="&lt;/div&gt;";tmpl+="&lt;/div&gt;";tmpl+='&lt;div class="PQAX_content"&gt;';tmpl+='&lt;div class="PQAQ_wrapper PQAQ_wrapper_color" id="pbwidgetcontainer"&gt;&lt;img style="width:31px !important" id="loadingimg" '+'src="'+pubbleLoader.servers.cdnDomain+'/images/app/qa/loading31.gif"&gt;&lt;/div&gt;';tmpl+="&lt;/div&gt;";tmpl+='&lt;div id="PQAQ_social" class="PQAQ_social" style="display:none"&gt;&lt;/div&gt;&lt;/div&gt; '}else{tmpl='&lt;div class="PQAQ_modal_all PQAQ_off"&gt;&lt;div class="PQAQ_modal"&gt;&lt;div class="PQAQ_modal_close"&gt;&lt;/div&gt; &lt;div class="PQAQ_modal_header"&gt;&lt;/div&gt;&lt;div class="PQAQ_modal_content"&gt;  &lt;/div&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class="PQAQ_wrapper PQAQ_wrapper_color" id="pbwidgetcontainer"&gt;&lt;img style="width:31px !important; height:31px !important" id="loadingimg" '+'src="'+pubbleLoader.servers.cdnDomain+'/images/app/qa/loading31.gif"&gt;&lt;/div&gt;&lt;div id="PQAQ_customcss" '+'class="PQAQ_customcss"&gt;&lt;style&gt;.pb_highlight{opacity:0.5}&lt;/style&gt;&lt;/div&gt;&lt;div id="PQAQ_social" class="PQAQ_social"&gt;&lt;/div&gt;'+'&lt;div id="PQAQ_debug" class="PQAQ_debug"&gt;&lt;/div&gt;'}}}else{if(c.layout=="modalbox"){tmpl='&lt;div class="PQAQ_modalbox" style="display:none"&gt;&lt;div class="PQAM_outer_window" style="display:none"&gt;'+'&lt;div class="PQAM_window"&gt;&lt;div class="PQAM_header"&gt;&lt;a class="PQAM_close" href="javascript:void(0);"&gt;&lt;/a&gt;      '+'             &lt;div class="PQAQ_status"&gt;&lt;div class="PQAQ_btn_i PQAQ_hide"&gt;&lt;/div&gt;&lt;div class="PQAQ_status_content PQAQ_hide"&gt;'+'&lt;div class="PQAQ_status_title_u"&gt;     &lt;/div&gt;&lt;div class="PQAQ_moderators"&gt;&lt;span id="PQAQ_mod_lists"&gt;'+'&lt;/span&gt;&lt;div class="PQAQ_moderators_text"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="PQAQ_followers"&gt;&lt;span id="PQAQ_follower_lists"&gt;'+'&lt;/span&gt;&lt;div class="PQAQ_status_text"&gt;&lt;/div&gt;&lt;div class="PQAQ_status_nr"&gt;&lt;div id="PQAQ_status_nrq"&gt;&lt;/div&gt;'+'&lt;div id="PQAQ_status_nrf"&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="PQAQ_status_u"&gt;&lt;div class="PQAQ_btn_u"&gt;&lt;/div&gt;'+'&lt;div class="PQAQ_status_content PQAQ_hide"&gt;&lt;div class="PQAQ_status_title "&gt;  &lt;/div&gt;&lt;div class="PQAQ_userstatus"&gt;'+'&lt;input class="PQAQ_userstatus_button" name="" type="button" value="" /&gt; &lt;div class="PQAQ_userstatus_text"&gt;   '+' &lt;/div&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;            &lt;div class="PQAM_title" id="PQAQ_title_mb"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="PQAM_middle"&gt;   '+'  &lt;div class="PQAQ_wrapper PQAQ_wrapper_color" id="pbwidgetcontainer"&gt;&lt;img id="loadingimg" '+'src="'+pubbleLoader.servers.cdnDomain+'/images/app/qa/loading31.gif"&gt;&lt;/div&gt;&lt;div id="PQAQ_customcss" class="PQAQ_customcss"&gt;'+'&lt;style&gt;&lt;/style&gt;&lt;/div&gt;&lt;div id="PQAQ_debug" class="PQAQ_debug"&gt;&lt;/div&gt;&lt;div id="PQAQ_social" class="PQAQ_social"&gt;&lt;/div&gt;  '+'     &lt;/div&gt;&lt;div class="PQAM_footer_line"&gt;&lt;/div&gt;&lt;div class="PQAM_footer"&gt;&lt;div class="PQAM_poweredby PQAQ_pubble_logo" '+'id="PQAQ_logo_mb"&gt;&lt;/div&gt;&lt;div class="PQAM_status"&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;'
  }else{if(!c.qav3){tmpl='&lt;div class="PQAQ_wrapper PQAQ_wrapper_color" id="pbwidgetcontainer"&gt;&lt;img id="loadingimg" '+'style="width:31px !important" src="'+pubbleLoader.servers.cdnDomain+'/images/app/qa/loading31.gif"&gt;&lt;/div&gt;&lt;div id="PQAQ_customcss" '+'class="PQAQ_customcss"&gt;&lt;style&gt;.pb_highlight{opacity:0.5}&lt;/style&gt;&lt;/div&gt;&lt;div id="PQAQ_social" class="PQAQ_social"&gt;&lt;/div&gt;'+'&lt;div id="PQAQ_debug" class="PQAQ_debug"&gt;&lt;/div&gt;'}else{tmpl='&lt;div class="PQAQ_modal_all PQAQ_off"&gt;&lt;div class="PQAQ_modal"&gt;&lt;div class="PQAQ_modal_close"&gt;&lt;/div&gt;&lt;div class="PQAQ_modal_header"&gt;&lt;/div&gt;&lt;div class="PQAQ_modal_content"&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class="PQAQ_wrapper PQAQ_wrapper_color" id="pbwidgetcontainer"&gt;&lt;img id="loadingimg" '+'style="width:31px !important" src="'+pubbleLoader.servers.cdnDomain+'/images/app/qa/loading31.gif"&gt;&lt;/div&gt;&lt;div id="PQAQ_customcss" '+'class="PQAQ_customcss"&gt;&lt;style&gt;.pb_highlight{opacity:0.5}&lt;/style&gt;&lt;/div&gt;&lt;div id="PQAQ_social" class="PQAQ_social"&gt;&lt;/div&gt;'+'&lt;div id="PQAQ_debug" class="PQAQ_debug"&gt;&lt;/div&gt;'}}}}obj.innerHTML=tmpl;if(!c.qav4){if(c.qav3){initModule.loadLink("https://d2dfzm19238yrf.cloudfront.net/LQA/css/LQA_style.css")}else{initModule.loadLink("//www.pubble.io/resources/core/PQAB_style_v02.css")}if(navigator.userAgent.indexOf(" MSIE ")&gt;-1){if(document.documentMode&lt;9){c.theme="PQAM"}}if(c.theme=="PQAM"){initModule.loadLink(pubbleLoader.servers.cdnDomain+"/qabuttons/css/template_metro.css")}else{if(c.theme=="PQAC"){initModule.loadLink(pubbleLoader.servers.cdnDomain+"/qabuttons/css/template_classic.css")}else{initModule.loadLink(pubbleLoader.servers.cdnDomain+"/qabuttons/css/template_modern.css")}}}var pusherLib=("https:"==document.location.protocol)?"https://js.pusher.com/2.2/pusher.min.js":"http://js.pusher.com/2.2/pusher.min.js";DynamicLoadScriptQueue.AddTask(pusherLib,"utf-8");if(!c.qav4){if(pubbleLoader.utils.isMobile()&amp;&amp;!c.qav3){initModule.loadLink(pubbleLoader.servers.cdnDomain+"/css/app/qa/PQAB_style_mobile.css","UTF-8")}if(c.layout=="modalbox"){initModule.loadLink(pubbleLoader.servers.cdnDomain+"/css/app/qa/PQAB_style_modal.css","UTF-8")}if(location.href.indexOf("facebook/qa")!==-1){c.scriptURL="//www.pubble.co/resources/javascript/widget/lib3.js"}}c.strings={};DynamicLoadScriptQueue.AddTask(c.scriptURL,"UTF-8");pubbleLoader.apps.push(c)}}}}};pubbleLoader.servers.cdnDomain=(("https:"==document.location.protocol)?"https://d2dfzm19238yrf.cloudfront.net":"https://d2dfzm19238yrf.cloudfront.net");window.pubbleLoader_init=true;return pubbleLoader})()}if(typeof(pubbleLoader)==="undefined"){pubbleLoader={}}if(typeof(pubbleLoader.config)==="undefined"){pubbleLoader.config={}}if(typeof(pubbleLoader.config.strings)==="undefined"){pubbleLoader.config.strings={}}if(typeof(pubbleLoader.init)==="undefined"){pubbleLoader.config={}}if(typeof(pubbleLoader.modules)==="undefined"){pubbleLoader.modules={}}pubbleLoader.views={};var DynamicLoadScriptQueue={Loading:false,TaskQueue:[],CallBack:function(StartTime,CallBackMethod){CallBackMethod&amp;&amp;CallBackMethod(new Date().valueOf()-StartTime.valueOf());this.Loading=false;this.Load()},Load:function(){var toLoad=false;toLoad=(!this.Loading&amp;&amp;this.TaskQueue.length);if(toLoad){var Head=document.getElementsByTagName("head")[0];if(!Head){Head=document.getElementsByTagName("body")[0]}var DLSQ=this,TaskQueue=this.TaskQueue.shift(),StartTime=new Date;var Script;if(TaskQueue.href){Script=document.createElement("link")}else{Script=document.createElement("script")}this.Loading=true;Script.onload=Script.onreadystatechange=function(){if(Script&amp;&amp;Script.readyState&amp;&amp;Script.readyState!="loaded"&amp;&amp;Script.readyState!="complete"){return}Script.onload=Script.onreadystatechange=Script.onerror=null;DLSQ.CallBack(StartTime,TaskQueue.CallBackMethod);StartTime=TaskQueue=null};if(TaskQueue.href){Script.rel="stylesheet";Script.type="text/css";Script.href=TaskQueue.href;Script.media="all"}else{Script.src=TaskQueue.Src;Script.charset=TaskQueue.Charset||"utf-8"}var att=document.createAttribute("data");att.value="pb";Script.setAttributeNode(att);Head.appendChild(Script)}},AddTask:function(Src,Charset,CallBackMethod){if(Src.indexOf(".css")!=-1){this.TaskQueue.push({"href":Src,"rel":"stylesheet","type":"text/css","CallBackMethod":CallBackMethod})}else{this.TaskQueue.push({"Src":Src,"Charset":Charset,"CallBackMethod":CallBackMethod});this.Load()}}};pubbleLoader.utils={checkMetaView:function(){var metas=document.getElementsByTagName("meta");for(var i=0;i&lt;metas.length;i++){if(metas[i].getAttribute("property")=="viewport"){return 1}}return 0},IE:function(){var trident=!!navigator.userAgent.match(/Trident\/7.0/);var rv=navigator.userAgent.indexOf("rv:11.0");var checked=false;var isIE=navigator.userAgent.indexOf(" MSIE ")&gt;-1;if(isIE){checked=true}else{if(trident&amp;&amp;rv!=-1){checked=true}}return checked},Safari:function(){return/Safari/.test(navigator.userAgent)&amp;&amp;/Apple Computer/.test(navigator.vendor)},Webkit:function(){return navigator.userAgent.match(/Webkit/i)},Android:function(){return navigator.userAgent.match(/Android/i)
  },BlackBerry:function(){return navigator.userAgent.match(/BlackBerry/i)},iOS:function(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)},iPad:function(){return navigator.userAgent.match(/iPad/i)},Opera:function(){return navigator.userAgent.match(/Opera Mini/i)},Windows:function(){return navigator.userAgent.match(/IEMobile/i)},any:function(){return(this.Android()||this.BlackBerry()||this.iOS()||this.Opera()||this.Windows())},isMobile:function(){var check=false;(function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|nexus|elaine|fennec|hiptop|iemobile|iPad|ip(hone|od|pad)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))){check=true}})(navigator.userAgent||navigator.vendor||window.opera);return check},getQueryString:function(name){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regexS="[\\?&amp;]"+name+"=([^&amp;#]*)";var regex=new RegExp(regexS);var results=regex.exec(window.location.href);if(results==null){return null}else{return results[1]}},String:{toParams:function(obj){var ar=[];for(var x in obj){ar.push(x+"="+obj[x])}return ar.join("&amp;")}},Url:{encode:function(a){return escape(this._utf8_encode(a))},decode:function(a){return this._utf8_decode(unescape(a))},_utf8_encode:function(b){b=b.replace(/\r\n/g,"\n");var a="";for(var e=0;e&lt;b.length;e++){var d=b.charCodeAt(e);if(d&lt;128){a+=String.fromCharCode(d)}else{if((d&gt;127)&amp;&amp;(d&lt;2048)){a+=String.fromCharCode((d&gt;&gt;6)|192);a+=String.fromCharCode((d&amp;63)|128)}else{a+=String.fromCharCode((d&gt;&gt;12)|224);a+=String.fromCharCode(((d&gt;&gt;6)&amp;63)|128);a+=String.fromCharCode((d&amp;63)|128)}}}return a},_utf8_decode:function(a){var b="";var d=0;var e=c1=c2=0;while(d&lt;a.length){e=a.charCodeAt(d);if(e&lt;128){b+=String.fromCharCode(e);d++}else{if((e&gt;191)&amp;&amp;(e&lt;224)){c2=a.charCodeAt(d+1);b+=String.fromCharCode(((e&amp;31)&lt;&lt;6)|(c2&amp;63));d+=2}else{c2=a.charCodeAt(d+1);c3=a.charCodeAt(d+2);b+=String.fromCharCode(((e&amp;15)&lt;&lt;12)|((c2&amp;63)&lt;&lt;6)|(c3&amp;63));d+=3}}}return b}}};if(pubbleLoader.utils.isMobile()){pubbleLoader.config.isMobile=1}if(window.pubbleApp_config){pubbleLoader(window.pubbleApp_config)}var pubbleLoader=pubbleLoader();function getElementsByClassName(className){var all=document.all?document.all:document.getElementsByTagName("*");var elements=new Array();for(var e=0;e&lt;all.length;e++){if((all[e].className+"").indexOf(className)&gt;-1){elements[elements.length]=all[e]}}return elements};
  </code></pre>