开发者

jQuery.load and form elements

Is jQuery's .load() supposed to be able to load <form> elements? Because it seems to be stripping them out. So I have some code like:

$('<div></div>').load($link.attr('href') + ' #divDlgContent', function(){ ... });

and when the $dialogcontents loads, I return some con开发者_开发百科tent with a <form> inside the DIV with the id 'divDlgContent'. Although the rest of the HTML inside the DIV is loaded, the <form> tags are stripped out. Is this by design, and is there a way I can load <form> elements this way?


The guy in this thread seems to have had a similar problem:

http://forum.jquery.com/topic/is-jquery-stripping-form-tags

It's such a long time ago I was dealing with this problem that I can't remember what my fix was. I think I either had 2 <form> tags in the document and .load() didn't like that, or it was a problem at a browser level, not a jQuery level, because .innerHTML didn't like <form> tags.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜