Wednesday, 15 May 2013

Magnific popup - undefined is not a function when parsing markup -


So I'm using a magnetic popup and whenever I use my own inline template and complete markup Parsing, line is failing 231. Here is my code:

This is my html:

   & Lt; / A & gt; & Lt; / Div & gt; & Lt; Div square = "piece" & gt; & Lt; A rel = "gallery" title = "girl kissing father" href = "/ themes / images / grid / image2.png" data-description = "" & gt; & Lt; P class = "caption" & gt; Girl kissing father & lt; / P & gt; & Lt; Img src = "/ themes / images / grid / image2.png" alt = "picture" /> & Lt; / A & gt; & Lt; / Div & gt; & Lt; / Div & gt;  

This is my JavaScript:

  var data = []; $ ('Gallery One') Each (function (e) {var item = {title} $ (this) .attr ('title'), href_img: $ (this) .attr ('href'), description: $ (this) .attr ('data -details')}; Datasheet (item);}); $ ("Gallery"). MagnificPopup ({Representative: 'A', Type: 'Image', Item: Data, Type: 'Inline', Close ContentClick: True, Inline: {// Defined Markup. Name Mark Mark: '& lt; div class = White-popup "& gt; div class =" mfp-close "> 
& # 39; + & # 39; span class =" mfp-title "& gt; & lt; / lt; / Div & gt; '+' & lt; div class = "mfp-href" & gt; & lt; / div & gt; '+' & lt; div class = "mfp-description" & gt; & lt; / Div> '+' & lt; / div & gt; '}, gallery: {enabled: true}});

The failed line 231 has a great popup that is in the _parseMarkup function. How this function looks:

  _parseMarkup: function (B, C, D) {var e; D.data and amp; Amp; (C = a.extend (d.data, c)), y (f, [b, c, d]), a.each (c, function (a, c) {if (c === undefined || C ===! 1) Return! 0; e = a.split ("_"); if (e.length & gt; 1) {var d = b.find (j + "-" + E [0] ); If (d.length & gt; 0) {var f = e [1]; f === "with replacement"? D [0]! == C [0] and D. location (c) ): F. === "img"? D.is ("img")? D.attr ("src", c): D. location (''  '): d.attr (e [1], c)}} and b.find (j + "-" + a) .html ( C)})},  

code: e = a.split ("_"); is unsuccessful .. It is saying that there is no undefined function. I did a console.log (a) and before that error has been thrown, 0 has been returned .. I do not know where he got from 0, though not sure ..

When I do a console (.log) on ​​my data variable, this is what is being pulled:

  object, purpose] 0: Object details: "" href_img: "http : //rayndee.localhost/themes/light-fixed-width/images/grid/image2.png "Title:" Girl Kiss Father "__Pooto__: Object 1: Object Description:" This is a description of "href_img:" http: / /rayndee.localhost/ Theme / light-fixed-width / images / grid / image 1 page "Title:" Girl Holding Flowers "__Pooto__: Object Length: 2__Pooto__: Array [0]  

Any help Thank you !


No comments:

Post a Comment