jquery - .data() value of DOM element is undefined except by iframe -


html:

  & lt; div id = "module" डेटा-लोड = "झूठा "& gt; Index.html:  
  console.log ($ ('# मॉड्यूल') से। खिड़की पर लोड करें। डेटा ('लोड')); // rewards 'undefined' । Index.html में निहित iframe से window.onload:  
  console.log ($ ('# मॉड्यूल')। डेटा ( 'लोड'));  

क्यों यह पहली बार अपरिभाषित है, लेकिन जब आईफ्रेम डेटा का उपयोग करने के लिए जेएस फ़ाइल का उपयोग करता है, तो इसे परिभाषित किया जाता है?

यहां बताया गया है कि कैसे मैं जेएसफिल्ड में बहुत ज्यादा इसे स्थापित किया गया है

मेरे घर का भी एक ही .js फ़ाइल का उपयोग करता है, लेकिन जब आइफ्रेम भार, कंसोल आउटपुट गलत है।

< P> संपादित करें: थोड़ा और काम करने के बाद, मुझे लगता है कि दूसरा लोड वास्तव में शुरुआती HTML लोड हो रहा है, पहले आइफ्रेम है।


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

c# - Create dynamic LINQ query expression at runtime which translates into a parameterized SQL query for nullable types -

cmake - cpack generates RPMs with %files entries that conflict with the RPM spec. How to fix? -