Hello All,
I am trying to save HTML (including all of the events) to an Oracle database. I can make this happen by getting innerHTML and using the javascript replace method to "re-add" my event handlers to my html string before writing it to the database. This is cumbersome and fairly messy. I am wondering if anyone has done anything like this before, or is there another way to capture the HTML (without using innerHTML) that would contain the events so that I did not have to use "replace" to update my string.
Thanks for the help.
Here is a streamlined version of my code:
element_html=tr1.innerHTML;
var str1="id=rowid_1"; //string to replace
var str2="id=row_id_1 onclick=alert("hello"); //replace str1 with this
element_html=element_html.replace(str5, str6);
write element_html to oracle database
I'm doing this because I am building a form builder application that allows users to build their own forms, which will be saved as html, and also can be opened again for editing.
BTW, the code should read
element_html=tr1.innerHTML;
var str1="id=rowid_1"; //string to replace
var str2="id=row_id_1 onclick=alert("hello"); //replace str1 with this
element_html=element_html.replace(str1, str2);
write element_html to oracle database
Bookmarks