admin管理员组文章数量:1391925
I have an ajax request which basically gets some HTML and puts it inside a <DIV>
tag.
However, if I then call something after this happens (like clicking a button) and try using div.append to that same DIV, I get the following error:
Uncaught Error: cannot call methods on resizable prior to initialization; attempted to call method 'option'
This is basically some snippets of my code:
if (formreq) {
$.ajax({
url: './json/admin/getHTML.php',
type: 'POST',
async: false,
data: { FORMSEQ : formreq } ,
dataType: 'json',
success: function(result)
{
var HTML = result["HTML"];
$('#blankform').append(HTML);
}
});
Then if I use something like:
$("#div_" + selectedItem).resizable('option', 'disabled',true);
Which the selector is a valid element on the HTML that was called via Ajax, I get the above error.
Any idea's? - Thanks
I have an ajax request which basically gets some HTML and puts it inside a <DIV>
tag.
However, if I then call something after this happens (like clicking a button) and try using div.append to that same DIV, I get the following error:
Uncaught Error: cannot call methods on resizable prior to initialization; attempted to call method 'option'
This is basically some snippets of my code:
if (formreq) {
$.ajax({
url: './json/admin/getHTML.php',
type: 'POST',
async: false,
data: { FORMSEQ : formreq } ,
dataType: 'json',
success: function(result)
{
var HTML = result["HTML"];
$('#blankform').append(HTML);
}
});
Then if I use something like:
$("#div_" + selectedItem).resizable('option', 'disabled',true);
Which the selector is a valid element on the HTML that was called via Ajax, I get the above error.
Any idea's? - Thanks
Share Improve this question asked Oct 18, 2013 at 13:42 realtekrealtek 8414 gold badges19 silver badges39 bronze badges 4- 1 When (and where) are you initializing the resizable widget? – Frédéric Hamidi Commented Oct 18, 2013 at 13:45
- Dynamically added elements are not automatically initialized in the currently used plugin. You will have to do it manually again. – Spokey Commented Oct 18, 2013 at 13:47
- Its being initialized after the Ajax request has been called, inside a .click event on another button 'outside' the #blankform DIV – realtek Commented Oct 18, 2013 at 13:47
-
You need to make sure you don't run the above
option
code before the user clicks on the button. – Barmar Commented Oct 18, 2013 at 13:52
1 Answer
Reset to default 5You need to initialize resizable with the disabled
option specified. It's in the documentation.
$( ".selector" ).resizable({ disabled: true });
本文标签:
版权声明:本文标题:javascript - Uncaught Error: cannot call methods on resizable prior to initialization; attempted to call method 'option& 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744702003a2620613.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论