Client is making a ajax call via jquery. After fetching the data from DB, I am returning the response. In this response i am applying lots of classes and styles to different html tags. This making the code look ugly.
while (my @data = $statement->fetchrow_array())
{
print " <li class='productWrap $data[7]' style='height:200px; width:150px;'>
<center>
<div class=\"productImageWrap\" id=\"productImageWrapID_$data[0]\">
<img src=$data[5] width='75' height='75'' />
</div>
<div>
<div style='font-size: 11px; font-family: \"Verdana\"; '> $data[6] $data[1] $data[2] </div>
<b>
<span> <strike> $data[3] </strike> $data[4] </span>
<a href='#' id=\"featuredProduct_$data[0]\" onclick=\" adjust_menu(this.id); simpleCart.add('name=$data[6] $data[1] $data[2]', 'price=$data[4]','image=$data[5]'); return false;\">
<img src='images/add-to-basket2.gif' alt='Add To Basket' width='111' height='32' id='featuredProduct+$data[0]' />
</a>
</b>
</div>
</center>
</li>";
}
Is there any way, so that i can avoid this. and apply the classes and styles at client side itself after getting the response?