I have two problems with append/prepend on JQuery. My code:
function toselect(f,d){
$('#workcont').remove('h2').load('pages/' + f + '.html #' + d).prepend('<h2>Some text</h2>');
calculate();
}
Div on default is clear <div id="workcont"></div>
Problems:
-
prependadd code for a second and then disappears, why? (not hide! removed) -
remove('h2')don’t remove added by prepend code. (if prepared wil be work) It’s some function in my .js file. -
function
calculate();does not apply to loaded content. Use with live() also not work.
try prepend in callback