PDA

View Full Version : How to embed an OL widget directly in page


shunting
09-19-2007, 08:53 AM
Forgive newbie-style question from rusty developer; I've been RTFMing, but if there's a passage that's directly on point, I've missed it:

Am I right in thinking that code like this *

<div class="embedded-canvas">
<script language="JavaScript" type="text/javascript">
Lz.swfEmbed({url: 'programs/calculator-$7.lzx?lzt=swf', id: 'd0e7311SWF', width: '800', height: '500'});
</script>
</div>

Means that I can directly embed an OL widget in an HTML page <i>without needing to add anything to the HTML header</i>? (My use case is that I would like users to be able to add code in one spot, a la YouTube, instead of two spots (the header and the body).

Thanks!

P.S. And, presumably, the url: could be from a remote server? And this syntax works for older versions of OL, not just 4.0? Thank you!


* From the calculator page:

http://www.openlaszlo.org/lps4/docs/guide/calculator.html

shunting
09-20-2007, 05:13 AM
No response on the post below, so:

Forgive newbie-style question from rusty developer; I've been RTFMing, but if there's a passage that's directly on point, I've missed it:

Am I right in thinking that code like this *

<div class="embedded-canvas">
<script language="JavaScript" type="text/javascript">
Lz.swfEmbed({url: 'programs/calculator-$7.lzx?lzt=swf', id: 'd0e7311SWF', width: '800', height: '500'});
</script>
</div>

Means that I can directly embed an OL widget in an HTML page <i>without needing to add anything to the HTML header</i>? (My use case is that I would like users to be able to add code in one spot, a la YouTube, instead of two spots (the header and the body).

Thanks!

P.S. And, presumably, the url: could be from a remote server? And this syntax works for older versions of OL, not just 4.0? Thank you!


* From the calculator page:

http://www.openlaszlo.org/lps4/docs/guide/calculator.html

But, to look again at the header on the calculator page:

<script type="text/javascript" language="JavaScript" src="../../lps/includes/embed-compressed.js">

So, I guess it's NOT possible to embed OL in the body without also messing with the header?