SimplePortal

Support => English Support => Topic started by: SeeingBlue on December 15, 2014, 04:04:41 PM

Title: Loading custom JS files
Post by: SeeingBlue on December 15, 2014, 04:04:41 PM
I'm using an iframe inside one of your HTML blocks to display some dynamic content. So I need this Iframe to resize based on the content. This can be achieved using David J. Bradshaw's Iframe-Resizer but it requires that I load some custom javascript files.

iframe.js
iframeResizer.contentWindow.min.js
iframeResizer.min.ja

I had this working properly in Wordpress. How do I do it properly for SMF/SimplePortal? Please be thorough, I'm not very savvy but I can follow directions.
Title: Re: Loading custom JS files
Post by: ♦ Ninja ZX-10RR ♦ on December 15, 2014, 05:09:47 PM
Can't you load them via the HTML itself? :)
Title: Re: Loading custom JS files
Post by: Chen Zhen on December 15, 2014, 08:46:07 PM
SeeingBlue,

I will assume this is using a HTML block.
You should use the full URL's of the file paths (including http:// if you wish) but I will just post this example of them being in the main directory. Place your iframe code after these file calls.
Code: [Select]
<script type="text/javascript" src="/iframe.js"></script>
<script type="text/javascript" src="/iframeResizer.contentWindow.min.js"></script>
<script type="text/javascript" src="/iframeResizer.min.ja"></script>
Title: Re: Loading custom JS files
Post by: ♦ Ninja ZX-10RR ♦ on December 16, 2014, 09:01:20 AM
The only reason why I didn't post the snippet is because he could have easily googled it with my advice ;) so why didn't I post it? Because it's much more satisfying and better to learn a bit by doing stuff on our own - but again why? Because if he has problems again then he will always have to ask and depend on somebody else (and maybe wait a long time and have his website bugged or, worse, down), instead if he knows already how to fix the stuff he won't be in that condition.
Said that, it will work indeed. :)
Title: Re: Loading custom JS files
Post by: SeeingBlue on December 16, 2014, 09:39:49 AM
That didn't work.
Title: Re: Loading custom JS files
Post by: SeeingBlue on December 16, 2014, 10:07:28 AM
I got it working. Had to load one of them after the iframe.
I've also had such a terrible time making post. Keep getting 500 server errors.
SimplePortal 2.3.8 © 2008-2024, SimplePortal