Exclude external URLs from Combine JS & Minify JS
-
Hello
I have a site built using DIVI theme. This website have external widgets embedded into website. These widgets are emebedded into pages using a JS file and an iframe.Example code widget embed is:
<script src="https://www2.pathToJS.com/inc/pcrframehost.js"></script><link rel="stylesheet" href="https://www2.pathToCSS.com/pcrframehost.css"><iframe frameborder="0" host="https://www2.pathToiFrame.com/pcrbin/reg5.aspx?username=PUBLIC&p2=&action=SEARCH&" id="pcrframe" name="pcrframe" src="about:blank" style="height:640px;width:100%;background-color:transparent;border:0;margin:0;padding:0" onload="pcrframeurl();"></iframe>
Now if i enable minify and combine JS files in SG optimizer settings then it breaks the iframe and in console it shows an error
‘Uncaught ReferenceError: pcrframeurl is not defined at HTMLIFrameElement.onload ((index):161)’
I need to exclude URL https://www2.pathToJS.com/inc/pcrframehost.jsv from minifying and combining. I have checked in SG optimizer settings and there i can only exclude files which are added using WP_Enqueue.
Kindly suggest solution or add support for excluding external URLS is coming update.
Thank you
Sajid
- The topic ‘Exclude external URLs from Combine JS & Minify JS’ is closed to new replies.