I have a strange problem happening on one page I am making:
myDiv.append("<img src='...' />") <--- WORKS
myDiv.find("p").append("whatever") <--- WORKS
myDiv.find("p").append("<img src='...' />") <--- FAILS!
On that last one nothing gets appended. I can’t see what is going wrong through Firebug. When I create new test page all three work, but I can’t get it to work on the real page. Any ideas what could be going on?
Ah sorry, I found out the problem which was not surprisingly due to conflicting scripts on the page. I had another script which was automatically removing empty elements in the area and apparently it considers img tags to be empty. The reason the first example I gave works is because it placed the images outside the scope that the deletion script was working. Doh.