문제

I have the following DOM object:

> this
<input type=​"checkbox" class=​"datafieldchk" data-collection=​"collection_name" 
data-column-id=​"rds_issuer" data-company-default=​"true" 
data-display-name=​"Issuer ID" data-physical-name=​"ISSR_ID">​

But, when I try to grab all the data into an array using jQuery (1.10.2), the collection value is missing.

> $(this).data()
Object {columnId: "rds_issuer", companyDefault: true, displayName: "Issuer ID", 
physicalName: "ISSR_ID"}

Accessing the property directly works fine:

> $(this).data("collection")
rds_issuer_inc

All of the properties are set directly on the object before page load, there's no jQuery manipulation or anything like that going on, it just doesn't like to get all of my properties.

도움이 되었습니까?

해결책

i tried changing lorenzo's jsfiddle with jquery 1.10.2 both uncompressed and minified and i've had no issues either. since accessing the property directly works, i would try testing this the same way the fiddle does - by displaying it on your ui instead of the console.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top