मेरे पास एक textbox , एक चेकबॉक्स और span टैग है जब मैं चेकबॉक्स पर क्लिक करता हूं, तो उसे span टैग में अपनी स्थिति दिखानी चाहिए। जब टेक्स्टबॉक्स नवीनीकृत हो जाता है, तो वह चेकबॉक्स ब्लॉक फिर से करता है जब आप अब चेकबॉक्स पर क्लिक करते हैं, तो यह राज्य को अपडेट करने में विफल रहता है। मैं चेक बॉक्स क्लिक ईवेंट के लिए पर ईवेंट हैंडलर का उपयोग कर रहा हूं, इसलिए मुझे उम्मीद है कि यह काम करेगा। कोई भी विचार क्यों यह अपेक्षित रूप से काम नहीं कर रहा है?
$ ('div [भूमिका] इनपुट [type = checkbox]')। पर (' क्लिक करें ', chg); $ ('Div [भूमिका] इनपुट [प्रकार = पाठ]')। पर ('इनपुट', स्रोत परिवर्तित); फ़ंक्शन chg () {var isitiki = $ (this) .is (": चेक"); । $ ( '# Upd') एचटीएमएल (istiki); } Function sourceChanged () {$ ('span', $ (this) .closest ('इनपुट-समूह'))। Html ('& lt; इनपुट प्रकार = "चेकबॉक्स" & gt;'); } & lt; script src = "https://ajax.googleapis.com/ajax/libs/ jQuery / 1.11.1 / jquery.min.js "& gt; & lt; / स्क्रिप्ट & gt; & Lt; div भूमिका = "टिकी" वर्ग = "इनपुट-समूह" & gt; & Lt; इनपुट प्रकार = "टेक्स्ट" वर्ग = "फॉर्म-कंट्रोल" / & gt; & Lt; span class = "input-group-addon" & gt; & lt; इनपुट प्रकार = "चेकबॉक्स" /> gt; & lt; / span & gt; & Lt; / div & gt; & Lt; span id = "upd" & gt; & lt; / span & gt;
जैसा कि आप गतिशील रूप से एक नया चेकबॉक्स बनाते हैं जब मान में परिवर्तन होता है, तो आपको घटना को गैर-गतिशील पूर्वजों को निर्दिष्ट करके अपने चेकबॉक्स में देना होगा:
$ ('Div [भूमिका]')। पर ('परिवर्तन', 'इनपुट [प्रकार = चेकबॉक्स]', chg); ध्यान दें कि मैंने परिवर्तन के बजाय को क्लिक के रूप में उपयोग किया है क्योंकि यह चेकबॉक्स के लिए अधिक उपयुक्त है।
नीचे दिए गए स्निपेट में मैंने $ (this) .is (": checked") को सिर्फ this.checked में बदल दिया है।
& lt; script src = "https://ajax.googleapis.com/ajax/libs/ jQuery / 1.11.1 / jquery.min.js "& gt; & lt; / स्क्रिप्ट & gt; & Lt; div भूमिका = "टिकी" वर्ग = "इनपुट-समूह" & gt; & Lt; इनपुट प्रकार = "टेक्स्ट" वर्ग = "फॉर्म-कंट्रोल" / & gt; & Lt; span class = "input-group-addon" & gt; & lt; इनपुट प्रकार = "चेकबॉक्स" /> gt; & lt; / span & gt; & Lt; / div & gt; & Lt; span id = "upd" & gt; & lt; / span & gt; यह भी ध्यान रखें कि यदि आप इसे false आपको अपने istiki चर को स्ट्रिंग में कनवर्ट करना चाहिए: $ ('# upd')। Html ('' + isticki);
Popular posts from this blog
सी / सी ++ में एक सरणी के लिए एक विशिष्ट घोषणा है: प्रकार का नाम [तत्व]; जहां एक प्रकार वैध है (जैसे कि इंट, फ्लोट ...), नाम एक मान्य पहचानकर्ता और तत्व फ़ील्ड है (जो हमेशा चौकोर ब्रैकेट्स [] में संलग्न होता है), सरणी की लंबाई को निर्दिष्ट करता है तत्वों की संख्या के संदर्भ में। इसलिए मैं एक सरणी की घोषणा करता हूँ जिसमें 2 तत्व हैं int a [2]; एक [3] = 4; क्यों यह अपवाद नहीं फेंकते? सीमा से बाहर की जाँच कुछ ऐसा है जो आप संभवतः जावा जैसे कुछ उच्च स्तर की भाषा से उपयोग किया जाता है। हालांकि सी / सी ++ में यह डिफ़ॉल्ट रूप से नहीं किया जाता है। यह आपको सरणी की सीमाओं की जांच करने के लिए एक छोटा प्रदर्शन हिट देता है और इसलिए सी तर्क यह है कि आप इसे स्वयं मैन्युअल रूप से कर सकते हैं, जब तक आप इसे सर्वश्रेष्ठ संभव प्रदर्शन की पेशकश कर सकते हैं। सी + + एसटीएल कंटेनर जैसे वेक्टर आमतौर पर एक पर () ऑपरेशन को बाध्य जांच करने के लिए समर्थन देता है और चूंकि आप [] अधिभार लोड कर सकते हैं - आप सरणी के लिए बाउंड-चेक सक्षम कर सकते हैं -स्टाइल एक्सेस। यदि सरणी एक कच्चे पॉइंटर ह...
When I'm trying to do a string, I get a patterninetex exception. ReplaceAll Below is my string Number of testcases: 39? Test case execution: testCreateDAta? Class has completed its performance: test.com.myspace.service.ejb.session.MyTest? Execution of test case ended: testCreateDAta? Test case execution: testUpdate? What I was trying to do: junitReportString.replaceAll ("?", "\ N"); The above code brought me an exception to: java.util.regex.PatternSyntaxException: Dangling meta character '?' After this I tried again with the code below: junitReportString.replaceAll ("\\?", "\ N"); The code above received me the same string as I mentioned above. My complete code: string junitReportString = new string (); MyApp = New URL ("http: // localhost: port / testWeb / TestJunit.jsp"); URL connection yc = myApp.openConnection (); Yc.connect (); JunitReportString = yc.getHeaderField ("finalJUNITR...
Is it true that Maven's real advantage is that its project structure is clearly defined and therefore it should be opened. Could any IDE support Maven? We develop a team of 5 people and we use three different IDEs (Intellees, Eclipse, Netbeans). I know that I can not open Eclipse an ant project in Netbeans but with Maven it is possible. Is it really reason enough to use Maven? Ante is the creation tool when the functionality of Maven accumulates: Construction equipment (included ant), Not only jar / war / project etc The order environment (such as starting a jetty and deploying its artifact) Unit Testing Li> Integration test Deployment (incrementing, incrementing versions, deploying artifacts etc.) More (see t for plugins on i-ne) Maven uses the lifestyle to achieve this goal. You can trigger some functionality at some points of the lifecycle. For example, the unit test should work fine after compiling, whereas integration testing ...
Comments
Post a Comment