隐藏到适当的json内容,解析并获取值

时间:2018-02-28 05:27:38

标签: javascript jquery json

无法解析属性中的json数据。

     <a href="" data-msg="{&quot;countryName&quot;:&quot;Afghanistan&quot;,&quot;cityName&quot;:&quot;Eshkashem&quot;,&quot;supplierType&quot;:&quot;RESTURENT&quot;,&quot;ProductType&quot;:&quot;Lunch&quot;,&quot;SupplierName&quot;:&quot;amuls&quot;,&quot;supplierTypeName&quot;:&quot;RESTURENT&quot;,&quot;products&quot;:{&quot;productName&quot;:&quot;ckTestt&quot;,&quot;productCode&quot;:&quot;QB8ZWUOF&quot;,&quot;productDescription&quot;:&quot;<p ><b>Nandamuri Taraka Rama Rao<\/b>&amp;nbsp;(28 May 1923<sup class=&quot;reference&quot; id=&quot;cite_ref-TheHindu_DOB_1-1&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-TheHindu_DOB-1&quot; >[ ]<\/a><\/sup>&amp;nbsp;&amp;ndash; 18 January 1996), popularly known as&amp;nbsp;<b>NTR<\/b>, was an Indian actor, producer, director, editor and politician who served as&amp;nbsp;<a href=&quot;https:\/\/en.wikipedia.org\/wiki\/List_of_Chief_Ministers_of_Andhra_Pradesh&quot;  title &quot;List of Chief Ministers of Andhra Pradesh&quot;>Chief Minister of Andhra Pradesh<\/a>&amp;nbsp;for seven years over three terms. NTR received three&amp;nbsp;<a class=&quot;mw-redirect&quot; href=&quot;https:\/\/en.wikipedia.org\/wiki\/National_Film_Awards_(India)&quot;  title &quot;National Film Awards (India)&quot;>National Film Awards<\/a>&amp;nbsp;for co-producing&amp;nbsp;<i><a class=&quot;mw-redirect&quot; href=&quot;https:\/\/en.wikipedia.org\/wiki\/Thodu_Dongalu_(1954_film)&quot;  title &quot;Thodu Dongalu (1954 film)&quot;>Thodu Dongalu<\/a><\/i>&amp;nbsp;(1954) and&amp;nbsp;<i><a class=&quot;mw-redirect&quot; href=&quot;https:\/\/en.wikipedia.org\/wiki\/Seetharama_Kalyanam&quot;  title &quot;Seetharama Kalyanam&quot;>Seetharama Kalyanam<\/a><\/i>&amp;nbsp;(1960) under&amp;nbsp;<a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._Trivikrama_Rao&quot;  title &quot;N. Trivikrama Rao&quot;>National Art Theater, Madras<\/a>,<sup class=&quot;reference&quot; id=&quot;cite_ref-3&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-3&quot; >[ ]<\/a><\/sup>&amp;nbsp;and directing&amp;nbsp;<i><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Varakatnam&quot;  title &quot;Varakatnam&quot;>Varakatnam<\/a><\/i>&amp;nbsp;(1970),<sup class=&quot;reference&quot; id=&quot;cite_ref-2ndawardPDF_4-0&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-2ndawardPDF-4&quot; >[ ]<\/a><\/sup>&amp;nbsp;NTR has received the erstwhile&amp;nbsp;<a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Rashtrapati_Award&quot;  title &quot;Rashtrapati Award&quot;>Rashtrapati Awards<\/a>&amp;nbsp;for his performance(s) in the films&amp;nbsp;<i><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Raju_Peda&quot;  title &quot;Raju Peda&quot;>Raju Peda<\/a><\/i>&amp;nbsp;(1954) and&amp;nbsp;<i><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Lava_Kusa&quot;  title &quot;Lava Kusa&quot;>Lava Kusa<\/a><\/i>&amp;nbsp;(1963).<sup class=&quot;reference&quot; id=&quot;cite_ref-Times_of_India_Press_5-0&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-Times_of_India_Press-5&quot; >[ ]<\/a><\/sup><sup class=&quot;reference&quot; id=&quot;cite_ref-RAJU-PEDA_1954_6-0&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-RAJU-PEDA_1954-6&quot; >[ ]<\/a><\/sup><sup class=&quot;reference&quot; id=&quot;cite_ref-Ramachandran_1973_7-0&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-Ramachandran_1973-7&quot; >[ ]<\/a><\/sup>&amp;nbsp;He garnered the&amp;nbsp;<a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Nandi_Award_for_Best_Actor&quot;  title &quot;Nandi Award for Best Actor&quot;>Nandi Award for Best Actor<\/a>&amp;nbsp;for&amp;nbsp;<i><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Kodalu_Diddina_Kapuram&quot;  title &quot;Kodalu Diddina Kapuram&quot;>Kodalu Diddina Kapuram<\/a><\/i>&amp;nbsp;in 1970, and the Inaugural&amp;nbsp;<a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Filmfare_Award_for_Best_Actor_–_Telugu&quot;  title &quot;Filmfare Award for Best Actor – Telugu&quot;>Filmfare Award for Best Actor &amp;ndash; Telugu<\/a>&amp;nbsp;in 1972 for&amp;nbsp;<i><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Badi_Panthulu&quot;  title &quot;Badi Panthulu&quot;>Badi Panthulu<\/a><\/i>.<sup class=&quot;reference&quot; id=&quot;cite_ref-Times_of_India_Press_5-1&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-Times_of_India_Press-5&quot; >[ ]<\/a><\/sup><sup class=&quot;reference&quot; id=&quot;cite_ref-Ramachandran_1973_7-1&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-Ramachandran_1973-7&quot; >[ ]<\/a><\/sup><sup class=&quot;reference&quot; id=&quot;cite_ref-Ramachandran_1973_7-2&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-Ramachandran_1973-7&quot; >[ ]<\/a><\/sup><sup class=&quot;reference&quot; id=&quot;cite_ref-8&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-8&quot; >[8]<\/a><\/sup><\/p>\n\n <p >NTR made his debut as an actor in a&amp;nbsp;<a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Telugu_cinema&quot;  title &quot;Telugu cinema&quot;>Telugu<\/a>&amp;nbsp;social film&amp;nbsp;<i><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Mana_Desam&quot;  title &quot;Mana Desam&quot;>Mana Desam<\/a><\/i>, directed by&amp;nbsp;<a href=&quot;https:\/\/en.wikipedia.org\/wiki\/L._V._Prasad&quot;  title &quot;L. V. Prasad&quot;>L. V. Prasad<\/a>&amp;nbsp;in 1949. He gained popularity in the 1950s when he became well known for his portrayals of&amp;nbsp;<a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Hindu&quot;  title &quot;Hindu&quot;>Hindu<\/a>&amp;nbsp;deities, especially&amp;nbsp;<a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Krishna&quot;  title &quot;Krishna&quot;>Krishna<\/a>&amp;nbsp;and&amp;nbsp;<a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Rama&quot;  title &quot;Rama&quot;>Rama<\/a>,<sup class=&quot;reference&quot; id=&quot;cite_ref-I96_9-0&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-I96-9&quot; >[ ]<\/a><\/sup>&amp;nbsp;roles which have made him a &amp;quot;messiah of the masses&amp;quot;.<sup class=&quot;reference&quot; id=&quot;cite_ref-10&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-10&quot; >[ 0]<\/a><\/sup>&amp;nbsp;He later became known for portraying antagonistic characters and&amp;nbsp;<a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Robin_Hood&quot;  title &quot;Robin Hood&quot;>Robin Hood<\/a>-esque hero characters in films. In total, he starred in 300 films, and has become one of the most prominent figures in the history of Telugu cinema.<sup class=&quot;reference&quot; id=&quot;cite_ref-autogenerated3_11-0&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-autogenerated3-11&quot; >[ 1]<\/a><\/sup><sup class=&quot;reference&quot; id=&quot;cite_ref-12&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-12&quot; >[ 2]<\/a><\/sup><sup class=&quot;reference&quot; id=&quot;cite_ref-Sashidhar_AS,_TNN_13_Aug_2012,_04.15PM_IST_13-0&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-Sashidhar_AS,_TNN_13_Aug_2012,_04.15PM_IST-13&quot; >[ 3]<\/a><\/sup><sup class=&quot;reference&quot; id=&quot;cite_ref-14&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-14&quot; >[ 4]<\/a><\/sup>&amp;nbsp;He was voted &amp;quot;Greatest Indian Actor of All Time&amp;quot; in a&amp;nbsp;<a class=&quot;mw-redirect&quot; href=&quot;https:\/\/en.wikipedia.org\/wiki\/CNN-IBN&quot;  title &quot;CNN-IBN&quot;>CNN-IBN<\/a>&amp;nbsp;national poll conducted in 2013 on the occasion of the Centenary of Indian Cinema.<sup class=&quot;reference&quot; id=&quot;cite_ref-15&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-15&quot; >[ 5]<\/a><\/sup><sup class=&quot;reference&quot; id=&quot;cite_ref-16&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-16&quot; >[ 6]<\/a><\/sup><sup class=&quot;reference&quot; id=&quot;cite_ref-17&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-17&quot; >[ 7]<\/a><\/sup><sup class=&quot;reference&quot; id=&quot;cite_ref-18&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-18&quot; >[18]<\/a><\/sup><\/p>\n&quot;,&quot;productImage&quot;:&quot;http:\/\/localhost\/nugds2.0\/assets\/mealsvoucher\/1930b4e48525b4f90add0d80d09ba7ff.jpg&quot;,&quot;productPdfFile&quot;:&quot;&quot;,&quot;productPrice&quot;:23,&quot;apiPrice&quot;:&quot;23&quot;,&quot;discountPrice&quot;:2,&quot;apiDiscountPrice&quot;:&quot;2&quot;,&quot;commissionPrice&quot;:0,&quot;apiCommissionPrice&quot;:0,&quot;productCurrency&quot;:&quot;SGD&quot;,&quot;productValidFrom&quot;:&quot;2018-02-28&quot;,&quot;productValidTo&quot;:&quot;2018-02-28&quot;,&quot;voucherValidTo&quot;:&quot;2018-02-28&quot;,&quot;termsAndConditions&quot;:&quot;<p ><b>Nandamuri Taraka Rama Rao<\/b>&amp;nbsp;(28 May 1923<sup class=&quot;reference&quot; id=&quot;cite_ref-TheHindu_DOB_1-1&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-TheHindu_DOB-1&quot; >[ ]<\/a><\/sup>&amp;nbsp;&amp;ndash; 18 January 1996), popularly known as&amp;nbsp;<b>NTR<\/b>, was an Indian actor, producer, director, editor and politician who served as&amp;nbsp;<a href=&quot;https:\/\/en.wikipedia.org\/wiki\/List_of_Chief_Ministers_of_Andhra_Pradesh&quot;  title &quot;List of Chief Ministers of Andhra Pradesh&quot;>Chief Minister of Andhra Pradesh<\/a>&amp;nbsp;for seven years over three terms. NTR received three&amp;nbsp;<a class=&quot;mw-redirect&quot; href=&quot;https:\/\/en.wikipedia.org\/wiki\/National_Film_Awards_(India)&quot;  title &quot;National Film Awards (India)&quot;>National Film Awards<\/a>&amp;nbsp;for co-producing&amp;nbsp;<i><a class=&quot;mw-redirect&quot; href=&quot;https:\/\/en.wikipedia.org\/wiki\/Thodu_Dongalu_(1954_film)&quot;  title &quot;Thodu Dongalu (1954 film)&quot;>Thodu Dongalu<\/a><\/i>&amp;nbsp;(1954) and&amp;nbsp;<i><a class=&quot;mw-redirect&quot; href=&quot;https:\/\/en.wikipedia.org\/wiki\/Seetharama_Kalyanam&quot;  title &quot;Seetharama Kalyanam&quot;>Seetharama Kalyanam<\/a><\/i>&amp;nbsp;(1960) under&amp;nbsp;<a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._Trivikrama_Rao&quot;  title &quot;N. Trivikrama Rao&quot;>National Art Theater, Madras<\/a>,<sup class=&quot;reference&quot; id=&quot;cite_ref-3&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-3&quot; >[ ]<\/a><\/sup>&amp;nbsp;and directing&amp;nbsp;<i><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Varakatnam&quot;  title &quot;Varakatnam&quot;>Varakatnam<\/a><\/i>&amp;nbsp;(1970),<sup class=&quot;reference&quot; id=&quot;cite_ref-2ndawardPDF_4-0&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-2ndawardPDF-4&quot; >[ ]<\/a><\/sup>&amp;nbsp;NTR has received the erstwhile&amp;nbsp;<a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Rashtrapati_Award&quot;  title &quot;Rashtrapati Award&quot;>Rashtrapati Awards<\/a>&amp;nbsp;for his performance(s) in the films&amp;nbsp;<i><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Raju_Peda&quot;  title &quot;Raju Peda&quot;>Raju Peda<\/a><\/i>&amp;nbsp;(1954) and&amp;nbsp;<i><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Lava_Kusa&quot;  title &quot;Lava Kusa&quot;>Lava Kusa<\/a><\/i>&amp;nbsp;(1963).<sup class=&quot;reference&quot; id=&quot;cite_ref-Times_of_India_Press_5-0&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-Times_of_India_Press-5&quot; >[ ]<\/a><\/sup><sup class=&quot;reference&quot; id=&quot;cite_ref-RAJU-PEDA_1954_6-0&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-RAJU-PEDA_1954-6&quot; >[ ]<\/a><\/sup><sup class=&quot;reference&quot; id=&quot;cite_ref-Ramachandran_1973_7-0&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-Ramachandran_1973-7&quot; >[ ]<\/a><\/sup>&amp;nbsp;He garnered the&amp;nbsp;<a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Nandi_Award_for_Best_Actor&quot;  title &quot;Nandi Award for Best Actor&quot;>Nandi Award for Best Actor<\/a>&amp;nbsp;for&amp;nbsp;<i><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Kodalu_Diddina_Kapuram&quot;  title &quot;Kodalu Diddina Kapuram&quot;>Kodalu Diddina Kapuram<\/a><\/i>&amp;nbsp;in 1970, and the Inaugural&amp;nbsp;<a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Filmfare_Award_for_Best_Actor_–_Telugu&quot;  title &quot;Filmfare Award for Best Actor – Telugu&quot;>Filmfare Award for Best Actor &amp;ndash; Telugu<\/a>&amp;nbsp;in 1972 for&amp;nbsp;<i><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Badi_Panthulu&quot;  title &quot;Badi Panthulu&quot;>Badi Panthulu<\/a><\/i>.<sup class=&quot;reference&quot; id=&quot;cite_ref-Times_of_India_Press_5-1&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-Times_of_India_Press-5&quot; >[ ]<\/a><\/sup><sup class=&quot;reference&quot; id=&quot;cite_ref-Ramachandran_1973_7-1&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-Ramachandran_1973-7&quot; >[ ]<\/a><\/sup><sup class=&quot;reference&quot; id=&quot;cite_ref-Ramachandran_1973_7-2&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-Ramachandran_1973-7&quot; >[ ]<\/a><\/sup><sup class=&quot;reference&quot; id=&quot;cite_ref-8&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-8&quot; >[8]<\/a><\/sup><\/p>\n\n <p >NTR made his debut as an actor in a&amp;nbsp;<a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Telugu_cinema&quot;  title &quot;Telugu cinema&quot;>Telugu<\/a>&amp;nbsp;social film&amp;nbsp;<i><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Mana_Desam&quot;  title &quot;Mana Desam&quot;>Mana Desam<\/a><\/i>, directed by&amp;nbsp;<a href=&quot;https:\/\/en.wikipedia.org\/wiki\/L._V._Prasad&quot;  title &quot;L. V. Prasad&quot;>L. V. Prasad<\/a>&amp;nbsp;in 1949. He gained popularity in the 1950s when he became well known for his portrayals of&amp;nbsp;<a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Hindu&quot;  title &quot;Hindu&quot;>Hindu<\/a>&amp;nbsp;deities, especially&amp;nbsp;<a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Krishna&quot;  title &quot;Krishna&quot;>Krishna<\/a>&amp;nbsp;and&amp;nbsp;<a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Rama&quot;  title &quot;Rama&quot;>Rama<\/a>,<sup class=&quot;reference&quot; id=&quot;cite_ref-I96_9-0&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-I96-9&quot; >[ ]<\/a><\/sup>&amp;nbsp;roles which have made him a &amp;quot;messiah of the masses&amp;quot;.<sup class=&quot;reference&quot; id=&quot;cite_ref-10&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-10&quot; >[ 0]<\/a><\/sup>&amp;nbsp;He later became known for portraying antagonistic characters and&amp;nbsp;<a href=&quot;https:\/\/en.wikipedia.org\/wiki\/Robin_Hood&quot;  title &quot;Robin Hood&quot;>Robin Hood<\/a>-esque hero characters in films. In total, he starred in 300 films, and has become one of the most prominent figures in the history of Telugu cinema.<sup class=&quot;reference&quot; id=&quot;cite_ref-autogenerated3_11-0&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-autogenerated3-11&quot; >[ 1]<\/a><\/sup><sup class=&quot;reference&quot; id=&quot;cite_ref-12&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-12&quot; >[ 2]<\/a><\/sup><sup class=&quot;reference&quot; id=&quot;cite_ref-Sashidhar_AS,_TNN_13_Aug_2012,_04.15PM_IST_13-0&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-Sashidhar_AS,_TNN_13_Aug_2012,_04.15PM_IST-13&quot; >[ 3]<\/a><\/sup><sup class=&quot;reference&quot; id=&quot;cite_ref-14&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-14&quot; >[ 4]<\/a><\/sup>&amp;nbsp;He was voted &amp;quot;Greatest Indian Actor of All Time&amp;quot; in a&amp;nbsp;<a class=&quot;mw-redirect&quot; href=&quot;https:\/\/en.wikipedia.org\/wiki\/CNN-IBN&quot;  title &quot;CNN-IBN&quot;>CNN-IBN<\/a>&amp;nbsp;national poll conducted in 2013 on the occasion of the Centenary of Indian Cinema.<sup class=&quot;reference&quot; id=&quot;cite_ref-15&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-15&quot; >[ 5]<\/a><\/sup><sup class=&quot;reference&quot; id=&quot;cite_ref-16&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-16&quot; >[ 6]<\/a><\/sup><sup class=&quot;reference&quot; id=&quot;cite_ref-17&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-17&quot; >[ 7]<\/a><\/sup><sup class=&quot;reference&quot; id=&quot;cite_ref-18&quot; ><a href=&quot;https:\/\/en.wikipedia.org\/wiki\/N._T._Rama_Rao#cite_note-18&quot; >[18]<\/a><\/sup><\/p>\n&quot;,&quot;availableQuantity&quot;:&quot;23&quot;,&quot;stockIn&quot;:&quot;23&quot;,&quot;createdBy&quot;:&quot;39&quot;,&quot;productId&quot;:&quot;86&quot;,&quot;countryId&quot;:&quot;1&quot;,&quot;cityId&quot;:&quot;5909&quot;,&quot;supplierTypeId&quot;:&quot;4&quot;,&quot;supplierId&quot;:&quot;6&quot;,&quot;productTypeId&quot;:&quot;5&quot;,&quot;productStatus&quot;:&quot;A&quot;,&quot;productapprovalStatus&quot;:&quot;N&quot;,&quot;redemptionStartFrom&quot;:&quot;2018-02-27&quot;,&quot;appointmentreq&quot;:&quot;I&quot;,&quot;limitTo&quot;:&quot;Male &amp; Female&quot;,&quot;ownCommission&quot;:&quot;3&quot;,&quot;createdDate&quot;:&quot;2018-02-27&quot;,&quot;ApprovalStatus&quot;:&quot;N&quot;},&quot;Branch&quot;:{&quot;branchId&quot;:&quot;16&quot;,&quot;branchName&quot;:&quot;hhhhhhhhv&quot;,&quot;branchAddress&quot;:&quot;hhhhhhhh&quot;,&quot;contactPerson&quot;:&quot;hhhhhhhh&quot;,&quot;landmark&quot;:&quot;hhhhhhhh&quot;,&quot;latitude&quot;:&quot;13.0827&quot;,&quot;longitude&quot;:&quot;80.2707&quot;,&quot;operatingHours&quot;:&quot;hhhhhhhh-hhhhhhhh&quot;,&quot;howToGetThere&quot;:&quot;hhhhhhhh&quot;,&quot;isdCode&quot;:&quot;+65&quot;,&quot;contactNumber&quot;:&quot;77777777&quot;},&quot;PriceRange&quot;:[],&quot;productImages&quot;:[&quot;http:\/\/localhost\/nugds2.0\/assets\/mealsvoucher\/29e7e26d5e50543148c3a89b8cf7652e.jpg&quot;,&quot;http:\/\/localhost\/nugds2.0\/assets\/mealsvoucher\/29e7e26d5e50543148c3a89b8cf7652e.jpg&quot;,&quot;http:\/\/localhost\/nugds2.0\/assets\/mealsvoucher\/29e7e26d5e50543148c3a89b8cf7652e.jpg&quot;,&quot;http:\/\/localhost\/nugds2.0\/assets\/mealsvoucher\/29e7e26d5e50543148c3a89b8cf7652e.jpg&quot;,&quot;http:\/\/localhost\/nugds2.0\/assets\/mealsvoucher\/bfc8afaed57fa949f1ca4d13f9b0472c.jpg&quot;,&quot;http:\/\/localhost\/nugds2.0\/assets\/mealsvoucher\/a4a3c8cfa5b569a371593b018110d755.jpg&quot;,&quot;http:\/\/localhost\/nugds2.0\/assets\/mealsvoucher\/6dc9a99e7ff7cc1ded508a630d9e0e07.jpeg&quot;]}" id="productNameEdit">Edit</a>

我尝试过两种方式

  • 在此无法获取值

        $(document).on('click','#productNameEdit',function(e){
            var finalData = JSON.stringify($(this).attr("data-msg").replace(/\\/g, ""));
            console.log(finalData);   
            var productDetails = JSON.parse(finalData);
        alert(finalData.countryName );
        }); 
    
  • 如果json内容不正确无法获取值,则能够获取数据

        $(document).on('click','#productNameEdit',function(e){
            var productDetails = JSON.parse(tjq(this).attr("data-msg"));
        alert(productDetails.countryName );
        });  
    

我做错了什么以及如何过来。

帮助我解析原始json中的任何更改数据。我试过两种方式仍然没有运气

0 个答案:

没有答案