Hi,
I used innerHTML like the following.
<script>
td_id.innerHTML="<script>functionname(param);</script>";
</script>
But this is not working. Can anyone help to solve this.
Regards,
Karthik.
Hi,
I used innerHTML like the following.
<script>
td_id.innerHTML="<script>functionname(param);</script>";
</script>
But this is not working. Can anyone help to solve this.
Regards,
Karthik.
Assuming that:
td_id
is a valid object that supports an innerHTML object (if it is, it would have needed to have been defined as such elsewhere and before this code is executed), the slash (/) should be escaped (\/) to contribute to the page's potential to pass validation. More importantly, you need to break up the </script> tag in the string literal. Otherwise, the script parser thinks it is the end of the script:
Code:td_id.innerHTML="<script>functionname(param);<"+"\/"+"script>";
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Thanx John, it's working fine
That's rather excessive:Originally Posted by jscheuer1
Notice that all that is necessary is a simple slash.Code:td_id.innerHTML = '<script type="text/javascript">functionname(param);<\/script>';
Mike
Bookmarks