javascript - Split an html document into multiple documents on form submit -
i want submit html text area , on submit want read file, find class selector , break down html multiple html files , save them in directory.
any ideas on how achieved?
for example let submit textarea , hit submit :
<table class="yoda"> <tr> <td></td> </tr> </table> <table class="yoda"> <tr> <td></td> </tr> </table>
on submit want grab each yoda , save in new html file in directory.
thank in advance. not sure if need use php achieve or if need use javascript.
you have 2 options
submit html via submit php , use simpledom library or php native dom/xml methods parse , save individual snippets (best method)
parse html on client (using jquery or native ) , submit json php (remember escape html strings). process json using php on server , save snippets.
Comments
Post a Comment