Response title
This is preview!




$(function() {
function IsValidImageUrl(url) {
$("<img>", {
src: url,
error: function() { return false; },
load: function() { return true; }
});
}
alert(IsValidImageUrl("http://goo.gl/GWtGo"));
alert(IsValidImageUrl("http://error"));
});
but of course it doesn't work. I need the function to return a boolean instead of alerting something because I want to validate a form. Possibly integrating with jQuery Validate. load() except i want to append data instead of replace. maybe i can use get() instead but i want to just extract the #posts element from the loaded data<div class="posts">
<div class="post">1. ...</div>
<div class="post">2. ...</div>
<div class="post">3. ...</div>
<div class="post">4. ...</div>
<div class="post">5. ...</div>
<div class="post">6. ...</div>
<div class="post">7. ...</div>
<div class="post">8. ...</div>
<div class="post">9. ...</div>
<div class="post">10 ...</div>
</div>
<ul id="pageNav" class="clearfix">
<li><a href="page1.html" class="active">1</a></li>
<li><a href="page2.html" class="next">2</a></li>
<li><a href="page3.html">3</a></li>
<li><a href="page4.html">4</a></li>
<li><a href="page5.html">5</a></li>
</ul>© 2012 jQuery Foundation
Sponsored by
and others.
