|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
weavexi Smarty n00b
Joined: 15 Jan 2009 Posts: 4
|
Posted: Thu Jan 15, 2009 2:52 am Post subject: Appending Html Codes or Scripts to the End of Body Tag |
|
|
hi,
i wish that we can append html codes or scripts to the end of Body tag.
example: showing dhtml popup that involves 2 steps.
step#1: place a javascript into onclick event
step#2: place html codes and necessary scripts to the end of body tag
now i want to implement it as a plugin function but need to do it in 1 step like below:
onclick="{dhtml_popup}"
then the corresponding html and script codes are added automatically to the end of body tag.
or maybe theres a way around it?
thanks _________________ weavexi
Smarty
The Practical Web Site Development Resource
Virtuemart Product Slideshow |
|
Back to top |
|
mitchenall Smarty Pro
Joined: 27 Feb 2004 Posts: 107 Location: London, UK
|
Posted: Thu Jan 15, 2009 1:12 pm Post subject: Re: Appending Html Codes or Scripts to the End of Body Tag |
|
|
Have you thought about keeping it all external and just setting up your event handlers by observing the dom:loaded event (if using something like prototype.js), e.g.
http://www.prototypejs.org/api/document/observe _________________ Mark Mitchenall |
|
Back to top |
|
weavexi Smarty n00b
Joined: 15 Jan 2009 Posts: 4
|
Posted: Fri Jan 16, 2009 5:29 am Post subject: |
|
|
here is a better example:
links like below can be anywhere on a page:
<a href="#" onclick="{dhtml_popup}">pop the dhtml window</a>
...
doing that, should also include the div block and the supporting javascripts to the end of body tag.
<script>...</script>
<div id="dhtml_window">
...
</div>
thing is, i don't want the div block and the supporting scripts to get included when the {dhtml_popup} is NOT specified anywhere on the page. _________________ weavexi
Smarty
The Practical Web Site Development Resource
Virtuemart Product Slideshow |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Jan 16, 2009 4:38 pm Post subject: |
|
|
There is an effort by boots called "SmartyDoc" floating around the forums that may help do what you want. Search for that. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|