javascript - How to catch uncaught type errors -


मेरे पास मेरे jQuery के लिए निम्न प्रारंभ है:

  (फ़ंक्शन ($) {$ .widget ('ui.hbTags', {options: {availableTags: [], नोड: झूठी, टैग सूची: गलत, विद्यमान टैग: गलत, प्लेसहोल्डर: गलत, अजाक्स यूआरएल: गलत, मौजूदा यूआरएल: गलत, csrftoken: false},   

हालांकि, मुझे uncaught typeerror अनिवार्य रूप से एक फ़ंक्शन नहीं लाइन 2 पर मिलता है। मुझे यह पता है क्योंकि ui.hb टैग तत्व नहीं है हर पृष्ठ, लेकिन मैं इस समस्या को कैसे रोकूं?

मैं सिर्फ जांच करूँगा कि टैग पर पृष्ठ से पहले मैं विजेट को कॉल करता हूं।

  (फ़ंक्शन ($) {if ($ ('ui.hbTags')। लंबाई & gt; 0) {$ .widget ('ui.hbTags', {Options: {availableTags: [], नोड: झूठे, टैग सूची: झूठे, विद्यमान टैग: गलत, प्लेसहोल्डर: झूठी, अजाक्स यूआरएल: गलत, विद्यमानउरेल: झूठी, सीएसआरएफटीoken: गलत},    

Comments

Popular posts from this blog

Out of index C/C++ -

algorithm - Graph cut with python: How to set up the graph correctly? -

objective c - how Set autolayout for multiple dynamic buttons and labells in iOS? -