Handling Clonenode On The Server
Solution 1:
You cannot see the newly created DIV
s beaceuse browser view-source
function renders the original HTML file that was downloaded from the server (before any JavaScript has taken an effect). If you want to see the real HTML as you see it in the browser, use the DomElement innerHTML
property, or some DOM inspector (Firebug for Firefox, DragonFly in opera, F12 in internet explorer).
What you should do is to send an AJAX request to the server with the information that some new data were created and have the server generate the new HTML. This should happen independently on the client addDetails
function.
On the client side, you also should remove the new DIV
if the AJAX call fails.
Because you didn't state how the page is generated, I can give you no leads how should the PHP script handle the AJAX requests. This is up to you unless you provide us with more details.
Post a Comment for "Handling Clonenode On The Server"