Hi, I have the same problem as noted here: https://siteorigin.com/thread/pasting-javascript-into-a-wiget-page-builder/
I have a javascript embed code that works when pasted into the text view of the core page content editor. It also works when pasted into a core text widget and used in a sidebar. However, it doesn’t work when pasted into any widget in a PageBuilder layout. I’ve tried the core text widget, the SiteOrigin Editor widget, and the Black Studio TinyMCE Widget.
When viewing the page, all that I see is
');. The page source shows most of the javascript, but it’s somehow mangled.
This is the original javascript, what I would paste into the text widget:
var fgConfig = (fgConfig !== undefined) ? fgConfig : []; fgConfig.push({ eventId:"39204", designId:"1479", Styles: "1", fgDomain: "//www.firstgiving.com", fgUrl:"http://www.firstgiving.com/vtso/burlington2016", includeButton:"true", hasTeams:"true", showGoal:"true", eventName:"Burlington Penguin Plunge", buttonColor:"ff0000", buttonText:"Register Today!", buttonTextColor:"fff", id:"event39204", embedType:"popup", embedhref:"//www.firstgiving.com/Participate/Register/embedded/39204/true?color=ff0000&textColor=fff", embedhrefOffline:"//www.firstgiving.com/fundraiseforanevent/embedded/39204/true?color=ff0000&textColor=fff", href:"//www.firstgiving.com/Participate/Register/embedded/39204", textShadow:"#333", start: "registrationStart", elID:"f2eba34c-357c-1035-837d-b22b74a6b458" }); document.write('');
Where you can see it working (using the core page content editor): http://penguinplunge.org/burlington/
Where you can see the problem:
And here is a page where you can see this: http://penguinplunge.org/temporary-javascript-problem-demo/
The other thread said this problem should be fixed in an upcoming release, but that was a few weeks ago. Any updates or suggestions?
Thank you!
Dan
URL: http://penguinplunge.org/temporary-javascript-problem-demo/
So I’ve looked into this a bit. It seems that the code from a core text widget in a page builder layout is saved properly to the wp_options table as a serialized object/array:
However, running the unserialize function returns this:
Notice that
So I’m not sure how to resolve this… can the code be escaped so that it passes through the deserializer properly?