jquery - Some strings are being displayed outside the <a> tag? -
so making jquery plugin gets headlines working fine, when try , output results on html page of headlines being displayed outside tag supposed inside?
html:
<div class="news"></div>
jquery:
$(el).append('<li class=' + options.listclassname + '>' + '<a href=' + link[1] + '>' + e.title + '</a></li>')
and when load webpage here how displayed when 'inspect element'
<div class="news"> <li class="item"> <a href="http://example.com/link/to/article.html"></a>article headline </li> <li class="item"> <a href="http://example.com/link/to/article.html">article headline</a> </li> <li class="item"> <a href="http://example.com/link/to/article.html">article headline</a> </li> <li class="item"> <a href="http://example.com/link/to/article.html">article headline</a> </li> <li class="item"> <a href="http://example.com/link/to/article.html">article headline</a> </li> <li class="item"> <a href="http://example.com/link/to/article.html"></a>article headline </li> <li class="item"> <a href="http://example.com/link/to/article.html">article headline</a> </li> <li class="item"> <a href="http://example.com/link/to/article.html"></a>article headline </li> <li class="item"> <a href="http://example.com/link/to/article.html"></a>article headline </li> <li class="item"> <a href="http://example.com/link/to/article.html">article headline</a> </li> </div>
as can see of headlines not inside tag whilst are?
any obliged!
regards, ben
try this:
<div><ul class="news"></ul></div> $('.news').append('<li class=\"' + options.listclassname + '\">' + '<a href=\"' + link[1] + '\">' + e.title + '</a></li>')
see \"
added.
Comments
Post a Comment