sharataka
sharataka

Reputation: 5132

Parsing json with javascript and displaying results error?

I am parsing a json feed with javascript and then displaying the results. I am also using jquery mobile. I find that when I parse and then display, a bullet appears for one of the li's and I don't why it's showing.

When I try to just statically display the results, this li bullet doesn't show. Any ideas on why this is happening?

Parsing json + displaying:

         $("#results").append('<ul data-role="listview" data-inset="true" data-theme="d" data-divider-theme="a" style="white-space:normal">   <a href="#page2" data-transition="slide">  <li data-role="list-divider" role="heading" class="ui-li ui-li-divider ui-btn ui-bar-c ui-corner-top">'+item.business.name+'</li> <li class="custom_listview_img" style = "background-image:url('+item.images.image_smart+');"></li></a></ul>');

Static display:

         <ul data-role="listview" data-inset="true" data-theme="d" data-divider-theme="a" style="white-space:normal"> 
            <a href="#page2" data-transition="slide">
            <li data-role="list-divider" role="heading" class="ui-li ui-li-divider ui-btn ui-bar-c ui-corner-top">Himalayan Flavors</li> 
            <li class="custom_listview_img" style = "background-image:url('http://c.yipitcdn.com/thumbor/SOWRPRFYvkagojw-sA_VPeSKK_k=/408x357/smart/c.yipitcdn.com/deal/20-to-spend-on-food-and-drink-3761-1374483321.jpg');"></li>
        </a>
        </ul>

Upvotes: 0

Views: 98

Answers (2)

ManMohan Vyas
ManMohan Vyas

Reputation: 4062

The most probable reason of this is their is a onload js that is changing the style of your list. so once the page is loaded. It is not called.

try calling expicilty eg after your code put

$("#listview").css("list-style-type","none");

And importantly THEIR IS NO JSON IN YOUR GIVEN CODE

Upvotes: 0

adeneo
adeneo

Reputation: 318182

This is a styling issue, do:

ul {list-style : none;}

in CSS to remove the bullets

FIDDLE

Upvotes: 1

Related Questions