我的json日期属性需要点击,需要做json Parse
<a href="" data-msg="{"countryName":"Afghanistan","cityName":"Eshkashem","supplierType":"RESTURENT","ProductType":"Dinner","SupplierName":"lassi","supplierTypeName":"RESTURENT","products":{"productName":"cktessst2","productCode":"JNM5B5MB","productDescription":"<p ><b>Information technology<\/b>&nbsp;(<b>IT<\/b>) is the application of&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Computer" title "Computer">computers<\/a>&nbsp;to store, retrieve, transmit and manipulate&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Data_(computing)" title "Data (computing)">data<\/a>,<sup class="reference" id="cite_ref-DOP_1-0" ><a href="https:\/\/en.wikipedia.org\/wiki\/Information_technology#cite_note-DOP-1" >[ ]<\/a><\/sup>&nbsp;or&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Information" title "Information">information<\/a>, often in the context of a business or other enterprise.<sup class="reference" id="cite_ref-2" ><a href="https:\/\/en.wikipedia.org\/wiki\/Information_technology#cite_note-2" >[ ]<\/a><\/sup>&nbsp;IT is considered to be a subset of&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Information_and_communications_technology" title "Information and communications technology">information and communications technology<\/a>&nbsp;(ICT). In 2012, Zuppo proposed an ICT hierarchy where each hierarchy level &quot;contain[s] some degree of commonality in that they are related to technologies that facilitate the transfer of information and various types of electronically mediated communications&quot;.<sup class="reference" id="cite_ref-Defining_ICT_in_a_Boundaryless_World:_The_Development_of_a_Working_Hierarchy_3-0" ><a href="https:\/\/en.wikipedia.org\/wiki\/Information_technology#cite_note-Defining_ICT_in_a_Boundaryless_World:_The_Development_of_a_Working_Hierarchy-3" >[3]<\/a><\/sup><\/p>\n\n <p >The term is commonly used as a&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Synonym" title "Synonym">synonym<\/a>&nbsp;for computers and computer networks, but it also encompasses other&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Information" title "Information">information<\/a>&nbsp;distribution technologies such as television and telephones. Several&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Computer_industry" title "Computer industry">industries<\/a>&nbsp;are associated with information technology, including&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Computer_hardware" title "Computer hardware">computer hardware<\/a>,&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Software" title "Software">software<\/a>,&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Electronics" title "Electronics">electronics<\/a>,&nbsp;<a class="mw-redirect" href="https:\/\/en.wikipedia.org\/wiki\/Semiconductors" title "Semiconductors">semiconductors<\/a>,&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Internet" title "Internet">internet<\/a>,&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Telecommunications_equipment" title "Telecommunications equipment">telecom equipment<\/a>, and&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/E-commerce" title "E-commerce">e-commerce<\/a>.<sup class="reference" id="cite_ref-DMC_4-0" ><a href="https:\/\/en.wikipedia.org\/wiki\/Information_technology#cite_note-DMC-4" >[ ]<\/a><\/sup>&nbsp;<sup class="reference" id="cite_ref-6" ><a href="https:\/\/en.wikipedia.org\/wiki\/Information_technology#cite_note-6" >[a]<\/a><\/sup><\/p>\n\n <p >Humans have been storing, retrieving, manipulating, and communicating information since the&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Sumer" title "Sumer">Sumerians<\/a>&nbsp;in&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Mesopotamia" title "Mesopotamia">Mesopotamia<\/a>&nbsp;developed&nbsp;<a class="mw-redirect" href="https:\/\/en.wikipedia.org\/wiki\/Cuneiform" title "Cuneiform">writing<\/a>&nbsp;in about 3000&nbsp;BC,<sup class="reference" id="cite_ref-Butler_7-0" ><a href="https:\/\/en.wikipedia.org\/wiki\/Information_technology#cite_note-Butler-7" >[ ]<\/a><\/sup>&nbsp;but the term&nbsp;<i>information technology<\/i>&nbsp;in its modern sense first appeared in a 1958 article published in the&nbsp;<i><a href="https:\/\/en.wikipedia.org\/wiki\/Harvard_Business_Review" title "Harvard Business Review">Harvard Business Review<\/a><\/i>; authors&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Harold_Leavitt" title "Harold Leavitt">Harold J. Leavitt<\/a>&nbsp;and Thomas L. Whisler commented that &quot;the new technology does not yet have a single established name. We shall call it information technology (IT).&quot; Their definition consists of three categories: techniques for processing, the application of statistical and mathematical methods to decision-making, and the simulation of higher-order thinking through computer programs.<sup class="reference" id="cite_ref-LeavittWhisler_8-0" ><a href="https:\/\/en.wikipedia.org\/wiki\/Information_technology#cite_note-LeavittWhisler-8" >[7]<\/a><\/sup><\/p>\n","productImage":"http:\/\/localhost\/nugds2.0\/assets\/mealsvoucher\/a3dcd8615aa646243e97234d4697cf22.jpg","productPdfFile":"","productPrice":23,"apiPrice":"23","discountPrice":2,"apiDiscountPrice":"2","commissionPrice":0,"apiCommissionPrice":0,"productCurrency":"SGD","productValidFrom":"2018-02-28","productValidTo":"2018-02-28","voucherValidTo":"2018-02-28","termsAndConditions":"<p ><b>Information technology<\/b>&nbsp;(<b>IT<\/b>) is the application of&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Computer" title "Computer">computers<\/a>&nbsp;to store, retrieve, transmit and manipulate&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Data_(computing)" title "Data (computing)">data<\/a>,<sup class="reference" id="cite_ref-DOP_1-0" ><a href="https:\/\/en.wikipedia.org\/wiki\/Information_technology#cite_note-DOP-1" >[ ]<\/a><\/sup>&nbsp;or&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Information" title "Information">information<\/a>, often in the context of a business or other enterprise.<sup class="reference" id="cite_ref-2" ><a href="https:\/\/en.wikipedia.org\/wiki\/Information_technology#cite_note-2" >[ ]<\/a><\/sup>&nbsp;IT is considered to be a subset of&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Information_and_communications_technology" title "Information and communications technology">information and communications technology<\/a>&nbsp;(ICT). In 2012, Zuppo proposed an ICT hierarchy where each hierarchy level &quot;contain[s] some degree of commonality in that they are related to technologies that facilitate the transfer of information and various types of electronically mediated communications&quot;.<sup class="reference" id="cite_ref-Defining_ICT_in_a_Boundaryless_World:_The_Development_of_a_Working_Hierarchy_3-0" ><a href="https:\/\/en.wikipedia.org\/wiki\/Information_technology#cite_note-Defining_ICT_in_a_Boundaryless_World:_The_Development_of_a_Working_Hierarchy-3" >[3]<\/a><\/sup><\/p>\n\n <p >The term is commonly used as a&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Synonym" title "Synonym">synonym<\/a>&nbsp;for computers and computer networks, but it also encompasses other&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Information" title "Information">information<\/a>&nbsp;distribution technologies such as television and telephones. Several&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Computer_industry" title "Computer industry">industries<\/a>&nbsp;are associated with information technology, including&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Computer_hardware" title "Computer hardware">computer hardware<\/a>,&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Software" title "Software">software<\/a>,&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Electronics" title "Electronics">electronics<\/a>,&nbsp;<a class="mw-redirect" href="https:\/\/en.wikipedia.org\/wiki\/Semiconductors" title "Semiconductors">semiconductors<\/a>,&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Internet" title "Internet">internet<\/a>,&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Telecommunications_equipment" title "Telecommunications equipment">telecom equipment<\/a>, and&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/E-commerce" title "E-commerce">e-commerce<\/a>.<sup class="reference" id="cite_ref-DMC_4-0" ><a href="https:\/\/en.wikipedia.org\/wiki\/Information_technology#cite_note-DMC-4" >[ ]<\/a><\/sup>&nbsp;<sup class="reference" id="cite_ref-6" ><a href="https:\/\/en.wikipedia.org\/wiki\/Information_technology#cite_note-6" >[a]<\/a><\/sup><\/p>\n\n <p >Humans have been storing, retrieving, manipulating, and communicating information since the&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Sumer" title "Sumer">Sumerians<\/a>&nbsp;in&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Mesopotamia" title "Mesopotamia">Mesopotamia<\/a>&nbsp;developed&nbsp;<a class="mw-redirect" href="https:\/\/en.wikipedia.org\/wiki\/Cuneiform" title "Cuneiform">writing<\/a>&nbsp;in about 3000&nbsp;BC,<sup class="reference" id="cite_ref-Butler_7-0" ><a href="https:\/\/en.wikipedia.org\/wiki\/Information_technology#cite_note-Butler-7" >[ ]<\/a><\/sup>&nbsp;but the term&nbsp;<i>information technology<\/i>&nbsp;in its modern sense first appeared in a 1958 article published in the&nbsp;<i><a href="https:\/\/en.wikipedia.org\/wiki\/Harvard_Business_Review" title "Harvard Business Review">Harvard Business Review<\/a><\/i>; authors&nbsp;<a href="https:\/\/en.wikipedia.org\/wiki\/Harold_Leavitt" title "Harold Leavitt">Harold J. Leavitt<\/a>&nbsp;and Thomas L. Whisler commented that &quot;the new technology does not yet have a single established name. We shall call it information technology (IT).&quot; Their definition consists of three categories: techniques for processing, the application of statistical and mathematical methods to decision-making, and the simulation of higher-order thinking through computer programs.<sup class="reference" id="cite_ref-LeavittWhisler_8-0" ><a href="https:\/\/en.wikipedia.org\/wiki\/Information_technology#cite_note-LeavittWhisler-8" >[7]<\/a><\/sup><\/p>\n","availableQuantity":"23","stockIn":"23","createdBy":"39","productId":"87","countryId":"1","cityId":"5909","supplierTypeId":"4","supplierId":"7","productTypeId":"6","productStatus":"A","productapprovalStatus":"N","redemptionStartFrom":"2018-02-28","appointmentreq":"I","limitTo":"Male & Female","ownCommission":"2","createdDate":"2018-02-28","ApprovalStatus":"N"},"Branch":{"branchId":"21","branchName":"eeeeeeeeeee","branchAddress":"sdfsfsdf","contactPerson":"sdfsdf","landmark":"sdfsdf","latitude":"sddfsdf","longitude":"sdfdsf","operatingHours":"12-32","howToGetThere":"sdfsdf","isdCode":"+65","contactNumber":"213123"},"PriceRange":[],"productImages":["http:\/\/localhost\/nugds2.0\/assets\/mealsvoucher\/7a11ac1712da8dd99af4ca8a952deff9.jpg","http:\/\/localhost\/nugds2.0\/assets\/mealsvoucher\/5f8f964a7c4bf5c9b0f8b90916c7ed58.jpg","http:\/\/localhost\/nugds2.0\/assets\/mealsvoucher\/0156b88e83e7c2ee3089cda7ab7b4e87.jpg","http:\/\/localhost\/nugds2.0\/assets\/mealsvoucher\/8f0fc2a6266d3f978f46770da484e981.jpg"]}" id="productNameEdit">Edit</a>
tjq(document).on('click','#productNameEdit',function(e){
var productDetails = JSON.parse(JSON.stringify(tjq(this).attr("data-msg")));
//var productDetails = JSON.parse(tjq(this).attr("data-msg"));
alert(productDetails.Branch.branchId)
});
需要获得价值。以不同的方式结束 如果json内容正确,我需要得到甚至json内容不合适。帮助过来了
答案 0 :(得分:0)
我建议您确保API返回有效的JSON。对当前字符串进行一些替换将最终陷入混乱。