views:

64

answers:

1

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 content 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?

A: 

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.

Jez