javascript - Searching a content and alert if -
javascript - Searching a content and alert if -
i made search script searches "hallow" , alerts.
var item = $('td > a:contains("hallow")').text() if(item) { alert(item); }
this javascript working html:
<html><body><div style="padding:10px;"> <table width="469" cellspacing="0" cellpadding="2" border="0"> <tbody> <tr valign="top"> <td width="313"> <img width="11" height="10" src="graphics/default/miscellaneous/weight.gif" alt="yük: 3" title="yük: 3"> <a href="characterdetails.asp?action=viewitemdetails&itemtypeid=236&itemid=100084253&characterid=53845">kovboy çizmeleri</a> </td> <td width="140" align="right"> </td> </tr> <tr valign="top"> <td width="313"> <img width="11" height="10" src="graphics/default/miscellaneous/weight.gif" alt="yük: 5" title="yük: 5"> <a href="characterdetails.asp?action=viewitemdetails&itemtypeid=168&itemid=68615745&characterid=53845">halloween canavar maskesi</a> </td> <td width="140" align="right"> </td> </tr> </tbody></table> <table width="469" cellspacing="0" cellpadding="3" border="0"> </table> <br> <br> </div></body></html>
but item secured. , html this:
<html><body><div style="padding:10px;"> <table width="469" cellspacing="0" cellpadding="2" border="0"> <tbody> <tr valign="top"> <td width="313"> <img width="11" height="10" src="graphics/default/miscellaneous/weight.gif" alt="yük: 3" title="yük: 3"> <a href="characterdetails.asp?action=viewitemdetails&itemtypeid=236&itemid=100084253&characterid=53845">kovboy çizmeleri</a> </td> <td width="140" align="right"> </td> </tr> <tr valign="top"> <td width="313"> <img width="11" height="10" src="graphics/default/miscellaneous/weight.gif" alt="yük: 5" title="yük: 5"> <a href="characterdetails.asp?action=viewitemdetails&itemtypeid=168&itemid=68615745&characterid=53845">halloween canavar maskesi</a> </td> <td width="140" align="right"> secured </td> </tr> </tbody></table> <table width="469" cellspacing="0" cellpadding="3" border="0"> </table> <br> <br> </div></body></html>
i dont want javascript alert me if item secured.
function must that
var item = $('td > a:contains("hallow")').text() var itemsecured = (a code) if(itemsecured) { } else { alert(item) }
i need right version of code.
and important: have 2 items, 1 secured other not. javascript must alert me.
$('td > a:contains("hallow")').each(function(){ if($(this).parent().next('td').text() == 'secured') { // actions secured item } else { alert($(this).text()); } });
javascript jquery firefox greasemonkey
Comments
Post a Comment