开发者

jquery dynamic form error

开发者 https://www.devze.com 2022-12-12 22:04 出处:网络
I\'m having trouble implementing this jQuery plugin for dynamic forms while following this tutorial This simple code is giving me an error in Firefox 3.5.5.

I'm having trouble implementing this jQuery plugin for dynamic forms while following this tutorial

This simple code is giving me an error in Firefox 3.5.5.

$(document).ready(function(){  
    $('#duplicate').dynamic开发者_StackOverflow社区Form('#plus', '#minus', {limit:5});
});

and the error:

"$("#duplicate").dynamicForm is not a function"

There is an element in the HTML with id="duplicate" so I'm not sure what the error means.

Can anyone shed some insight on this issue?


Have you included jquery-dynamic-form.js in the head section of your page after the inclusion of the jquery library itself:

<script type="text/javascript" src="jquery.js"></script>    
<script type="text/javascript" src="jquery-dynamic-form.js"></script>


@buken how do you know that both are loading with no errors?

That error says that there is no function defined with that name for jQuery object. Probably that plug-in has not loaded properly when you try to use it.

Try checking $().dynamicForm in firebug console. If plugin is loaded it should output normalizeElmnt(elmnt). Check with example downloaded from http://code.google.com/p/jquery-dynamic-form/downloads/list, does it work or throws error?


After many hours of hair-pulling, I've finally fixed the issue. The culprit? Misspelling "text/javascript" in the script tag.

I think I'll take a nap now. Thanks everyone for your help.

0

精彩评论

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