2 PART QUESTIONS
(1) This is probably a simple question but I've been unable to find a conclusive answer via the search gods. I'm using jQuery's load() function to replace the body of an element with some new HTML, pretty standard stuff. However, if the element in question already contains HTML will the existing elements that are being replaced be removed from the DOM? For example, say I have the following:
And then doing a $('#replace_me').load(....), will the P element above be removed from the DOM? What would be a good way for me to
test that this is the case?
(2) Let's assume the answer to part 1 is YES, the elements to be replaced are removed from the DOM. What about JavaScript that might have come down with the new response? What happens to variables and the like that are eval'd from the load() function when the new response comes in. So assume something like:
What happens to the name variable when the contents of 'replace_me' gets replaced?
Thanks