kimoo
April 30th, 2008, 12:42 PM
<script type="text/javascript">
function xx(){
document.getElementById('x').innerHTML="<script>function t(){alert('here');}</script>";
}
</script>
<a onClick="xx();">Send Function</a>
<a onClick="t();">test Function</a>
<div id="x"></div>
In the above function i am trying to send a <script> containing a function t();
when i click on the Anchor tag "Send Function".
Then upon clicking the Test function Anchor tag it is supposed to run the t() function which it DOES NOT can anybody tell me the reason..
regards,
kimoo
function xx(){
document.getElementById('x').innerHTML="<script>function t(){alert('here');}</script>";
}
</script>
<a onClick="xx();">Send Function</a>
<a onClick="t();">test Function</a>
<div id="x"></div>
In the above function i am trying to send a <script> containing a function t();
when i click on the Anchor tag "Send Function".
Then upon clicking the Test function Anchor tag it is supposed to run the t() function which it DOES NOT can anybody tell me the reason..
regards,
kimoo