I have a javascript function that takes two string parameters. The function dynamically updates a section of my site wtih the string content passed to it. The problem I'm having is that the strings contain both a javascript function call as well as other HTML tags. I think this is messing my page up, so I'm wondering what the best approach/solution would be. Here is the line of code that I have:
document.getElementById("month1").innerHTML = " &_nbsp;&_raquo; &_nbsp;&_nbsp;<a href=http://www.webdeveloper.com/forum/archive/index.php/javascript:rewrite('still looking for gift ideas?', '<img src=http://www.webdeveloper.com/forum/archive/index.php/./images/post_images/topicjournal.gif align=right border=0 alt=Topic Journal vspace=20 hspace=20>some lines of test')>link name</a>;
What to I need to do to have the HTML tags not be seen as a part of the page?
Also, I don't think javascript is capable of working with files on the server, so I have a little php code for that. The php code gets the content from various files and the javascript function uses that to change the innerHTML. I've seen on various sites that javascript plays nicely inside of php code, but it doesn't seem to happy about doing things the other way around.
document.getElementById("month1").innerHTML = " &_nbsp;&_raquo; &_nbsp;&_nbsp;<a href=http://www.webdeveloper.com/forum/archive/index.php/javascript:rewrite('still looking for gift ideas?', '<img src=http://www.webdeveloper.com/forum/archive/index.php/./images/post_images/topicjournal.gif align=right border=0 alt=Topic Journal vspace=20 hspace=20>some lines of test')>link name</a>;
What to I need to do to have the HTML tags not be seen as a part of the page?
Also, I don't think javascript is capable of working with files on the server, so I have a little php code for that. The php code gets the content from various files and the javascript function uses that to change the innerHTML. I've seen on various sites that javascript plays nicely inside of php code, but it doesn't seem to happy about doing things the other way around.