Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.
FreedomIOPList

Using script code in Custom Pages?

by FreedomIOPList, Last updated on 1 year ago in Code Snippet and functions - 8
I am having trouble embedding <script> codes in Custom Pages. Can you not embed <script> in Custom Pages in Fusion? The code I'm trying to embed is
<iframe id="JotFormIFrame-80704605582153" onload="window.parent.scrollTo(0,0)" allowtransparency="true" allowfullscreen="true" src="https://form.jotform.com/80704605582153" frameborder="0" style="width: 1px; min-width: 100%; height:539px; border:none;" scrolling="no" > </iframe> <script type="text/javascript"> var ifr = document.getElementById("JotFormIFrame-80704605582153"); if(window.location.href && window.location.href.indexOf("?") > -1) { var get = window.location.href.substr(window.location.href.indexOf("?") + 1); if(ifr && get.length > 0) { var src = ifr.src; src = src.indexOf("?") > -1 ? src + "&" + get : src + "?" + get; ifr.src = src; } } window.handleIFrameMessage = function(e) { var args = e.data.split(":"); if (args.length > 2) { iframe = document.getElementById("JotFormIFrame-" + args[(args.length - 1)]); } else { iframe = document.getElementById("JotFormIFrame"); } if (!iframe) { return; } switch (args[0]) { case "scrollIntoView": iframe.scrollIntoView(); break; case "setHeight": iframe.style.height = args[1] + "px"; break; case "collapseErrorPage": if (iframe.clientHeight > window.innerHeight) { iframe.style.height = window.innerHeight + "px"; } break; case "reloadPage": window.location.reload(); break; case "loadScript": var src = args[1]; if (args.length > 3) { src = args[1] + ':' + args[2]; } var script = document.createElement('script'); script.src = src; script.type = 'text/javascript'; document.body.appendChild(script); break; case "exitFullscreen": if (window.document.exitFullscreen) window.document.exitFullscreen(); else if (window.document.mozCancelFullScreen) window.document.mozCancelFullScreen(); else if (window.document.mozCancelFullscreen) window.document.mozCancelFullScreen(); else if (window.document.webkitExitFullscreen) window.document.webkitExitFullscreen(); else if (window.document.msExitFullscreen) window.document.msExitFullscreen(); break; } var isJotForm = (e.origin.indexOf("jotform") > -1) ? true : false; if(isJotForm && "contentWindow" in iframe && "postMessage" in iframe.contentWindow) { var urls = {"docurl":encodeURIComponent(document.URL),"referrer":encodeURIComponent(document.referrer)}; iframe.contentWindow.postMessage(JSON.stringify({"type":"urls","value":urls}), "*"); } }; if (window.addEventListener) { window.addEventListener("message", handleIFrameMessage, false); } else if (window.attachEvent) { window.attachEvent("onmessage", handleIFrameMessage); } </script>
My Sites

Freedom IOP List

http://www.freedomioplist.com




Heaven's Handmades

http://www.heavenshandmades.com




PHP-Fusion Projects Portal

http://www.phpfusionprojectportal.tk




Addiction Help By Addicts

http://www.addictionhelpbyaddicts.com



Use one of 2 methods. When you do your echo script use single quotes:
echo 'script code'; OR better yet:
Change all the double quotes in the statement to single quotes.
Energy can neither be created nor destroyed; only transformed !

Quote

Use one of 2 methods. When you do your echo script use single quotes:
echo 'script code'; OR better yet:
Change all the double quotes in the statement to single quotes.
- by Grimloch

Thanks very much for the info. I just created a new PHP page and put the code in it but I will remember this for future reference. Also, when using TinyMCE on the Custom Pages, do you put this in HTML or just paste it in the page?
My Sites

Freedom IOP List

http://www.freedomioplist.com




Heaven's Handmades

http://www.heavenshandmades.com




PHP-Fusion Projects Portal

http://www.phpfusionprojectportal.tk




Addiction Help By Addicts

http://www.addictionhelpbyaddicts.com



Quote

Thanks very much for the info. I just created a new PHP page and put the code in it but I will remember this for future reference. Also, when using TinyMCE on the Custom Pages, do you put this in HTML or just paste it in the page?
- by FreedomIOPList

Depends: Personally I almost always use html/tables depending on how much control over format I want in the output. And because I like controlling the output I NEVER NEVER EVER use TinyMCE on any of my websites. In my opinion it's a piece of crap cause it changes your code when you save it!
Energy can neither be created nor destroyed; only transformed !
You can view all discussion threads in this forum.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
Users who participated in discussion: Grimloch, FreedomIOPList