localendar Forums Homepage

Print at Dec 18, 2018, 10:58:16 PM View all posts in this thread on one page
Posted by halomotaf at Sep 7, 2014, 9:42:07 PM
embed mini-cal after dom loaded
hi
i am embedding the mini cal in my site' and it takes too much time to load, and preventing the site itself from being loaded
so i tried to load the calendar only after dom loaded, and didn't find how

could you help please ?

thanks
amir

Posted by jasonsullivan at Sep 11, 2014, 1:16:39 AM
Re: embed mini-cal after dom loaded
Could you provide a link to the page on your site where it is embedded?
----------------------------------------
Jason Sullivan
Support Associate
Localendar.com

Posted by halomotaf at Sep 20, 2014, 9:02:28 PM
Re: embed mini-cal after dom loaded
http://halomotaf.co.il/

Posted by support at Sep 22, 2014, 11:09:04 PM
Re: embed mini-cal after dom loaded
This is just a thought I had...
First, in the two places you include <script> tags supplied by localendar, replace them with something like this:
<div id="placeholder1">&nbsp;</div>
<div id="placeholder2">&nbsp;</div>

Then at the bottom of your page, try something like this:

<script>
var script1 = document.createElement('script');
script1.src = "http://www.localendar.com/js/PublishedIncludeMini.js";
document.getElementsById("placeholder1").appendChild(script1);

var script2 = document.createElement('script');
script2.src = "http://www.localendar.com/public/halomotaf?include=Y&style=M5";
document.getElementsById("placeholder2").appendChild(script2);
</script>


Disclaimer; I haven't tested that yet, but it seems like it might work...

BTW, can I ask how you achieved the result of reversing the calendar automatically?
----------------------------------------
Marc Higgins
Support Associate, localendar.com
Follow us on Twitter! http://www.twitter.com/localendar_news


Help! | Cobranding | Legal | Privacy Policy | About localendar.com | Contact Us