calendarxp Site Admin
Joined: 30 Jan 2005 Posts: 409
|
Posted: Tue Feb 15, 2005 7:33 pm Post subject: How can I create the calendar iframe tag dynamically using javascript? |
|
|
Some of our customers are interested in creating the calendar tag dynamically instead of having it written statically at the page bottom. The following code can do the trick on IE5+, Opera 7.54 and most Mozilla based browsers:
Code: | <script>
var html = '<ifr'+'ame name="gToday:normal:agenda.js" id="gToday:normal:agenda.js" src="ipopeng.htm" scrolling="no" frameborder="0" style="visibility:visible; z-index:999; position:absolute; top:-500px; left:-500px;"></ifr'+'ame>';
if (document.all)
document.body.insertAdjacentHTML('beforeEnd', html);
else {
var range = document.createRange();
range.setStartAfter(document.body.lastChild);
var docFrag = range.createContextualFragment(html);
document.body.appendChild(docFrag);
}
</script> |
It's not fully tested on every platform, but you got the idea on how to do it.
_________________ Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved. |
|