I'd like to apply the jquery themeroller highlight/error html to my jquery code. This is what the jquery highlight code is like (error code is similar):
<div class="ui-widget">
<div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
<p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
<strong>Hey!</strong> Sample ui-state-highlight style.</p>
</div>
</div>
I have my code structured like this:
function doAjax(){
$.ajax({
url: 'myfile.php',
success: function(data) {
if (data == 'Initializing...please wait')
{
$('#quote p').html(data); //here I would add highlight css code
setTimeout(doAjax, 2000);
}
else
{
$('#quote p').html(data); //here is error css code
}
}
});
}
This prints to a div:
<div id="quote"><p> </p></div>
Using .css() is cumbersome here, I think. Is there a way to add the html to the conditional? Note that .html(data) is necessary as you get different messages from the server, unless there are other suggestions.