Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Appending Html Codes or Scripts to the End of Body Tag

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
weavexi
Smarty n00b


Joined: 15 Jan 2009
Posts: 4

PostPosted: Thu Jan 15, 2009 2:52 am    Post subject: Appending Html Codes or Scripts to the End of Body Tag Reply with quote

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
View user's profile Send private message Visit poster's website
mitchenall
Smarty Pro


Joined: 27 Feb 2004
Posts: 107
Location: London, UK

PostPosted: Thu Jan 15, 2009 1:12 pm    Post subject: Re: Appending Html Codes or Scripts to the End of Body Tag Reply with quote

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
View user's profile Send private message Visit poster's website
weavexi
Smarty n00b


Joined: 15 Jan 2009
Posts: 4

PostPosted: Fri Jan 16, 2009 5:29 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Fri Jan 16, 2009 4:38 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Feature Requests All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP