Reputation: 95
I am having a trouble in jqm function
<span class="smaller gray">[ <span class="blueonly"><a href="javascript:void(0)" rel="nofollow" onclick="javascript:jQuery(\'#saved_search_modal\').jqm({modal: false}).jqmShow();" >' . $phrase['_save_as_favorite_search'] . '</a></span> ]</span>';
According to the above function when I click the Save search link it throws an error showing:
jQuery("#saved_search_modal").jqm is not a function
Why is it so... Can anyone suggest please?
Upvotes: 0
Views: 823
Reputation: 35582
Try this
$(document).ready(function(){
// write your code here, related to jqm.
});
Upvotes: 1
Reputation: 1314
You should check that your plugin has loaded properly and in time. You can use firebug for Firefox for this (or any other equivalent for other browsers)
Check the NET tab to see if your external files has loaded properly, and use the debugger to see if they has loaded before you try to use them.
Note that inline code like yours above makes it a bit harder to debug. I would seriously recommend detaching your javascript from your markup and put it in an external file.
Upvotes: 0