How can I find an #[ID]
using jQuery?
I have a handler that checks some info, I'm checking with jQuery if there is found a ID... But it always give back "Nothing" and it gives me the errors so it mean that there are errors!
I do it on this way...
jQuery:
posting.done(function(data){
var warnings = $(data).find('.warnings');
$('form#gastenboek').append(data);
if (warnings.length > 0) {
alert("errors")
} else {
alert("Nothing");
}
});
Handler:
if (!empty($warning) && isset($warning))
{
foreach($warning as $warning)
{
echo "<span id='warnings' style='color:orange;' class='glyphicon glyphicon-flag'></span><a style='color:orange;'>" . $warning . "</a><br>";
}
}