N
namemattersnot
Re,
SCENARIO: User clicks a link and a javascript function creates dynamic
content in <div id="content"></div> using:
document.getElementById("content").innerHTML = something [something is
a variable that holds a chuck of HTML code]
In the page's header I load a javascript that does nice effect to
pictures. In HTML code I have the following element that contains
referect for that said javascript:
<a href="a.jpg" rel="nice_effect">click for nice effect</a>
PROBLEM: Everything is properly displayed, however, javascript is not
activated when the link is pressed.
Now, I can use eval(something) to process a simple request such as
'alert("hello")', but how do I re-eval ALL javascripts that are
included in the page's header OR that are included in the content that
I am creating (i.e. in addition to a bunch of <a> elements, I will
include a <script> element)???
This following page shows a function that goes through the whole HTML
and re-declares all functions that are found in <script></script>
elements: http://www.modernmethod.com/sajax/forum/viewtopic.php?t=205
It appears to be the solution that I need, however, the code doesn't
seem to work (or perhaps I am not using it correctly) and the author
cannot be contacted.
Are there any knowledgeable people in this group who could please help
me? I need the javascript to work with elements that are dynamically
included in the page AFTER it is loaded.
Thank you!!!!!!!
SCENARIO: User clicks a link and a javascript function creates dynamic
content in <div id="content"></div> using:
document.getElementById("content").innerHTML = something [something is
a variable that holds a chuck of HTML code]
In the page's header I load a javascript that does nice effect to
pictures. In HTML code I have the following element that contains
referect for that said javascript:
<a href="a.jpg" rel="nice_effect">click for nice effect</a>
PROBLEM: Everything is properly displayed, however, javascript is not
activated when the link is pressed.
Now, I can use eval(something) to process a simple request such as
'alert("hello")', but how do I re-eval ALL javascripts that are
included in the page's header OR that are included in the content that
I am creating (i.e. in addition to a bunch of <a> elements, I will
include a <script> element)???
This following page shows a function that goes through the whole HTML
and re-declares all functions that are found in <script></script>
elements: http://www.modernmethod.com/sajax/forum/viewtopic.php?t=205
It appears to be the solution that I need, however, the code doesn't
seem to work (or perhaps I am not using it correctly) and the author
cannot be contacted.
Are there any knowledgeable people in this group who could please help
me? I need the javascript to work with elements that are dynamically
included in the page AFTER it is loaded.
Thank you!!!!!!!