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">&nbsp;<img width="11" height="10" src="graphics/default/miscellaneous/weight.gif" alt="yük: 3" title="yük: 3">&nbsp; <a href="characterdetails.asp?action=viewitemdetails&amp;itemtypeid=236&amp;itemid=100084253&amp;characterid=53845">kovboy çizmeleri</a> </td> <td width="140" align="right"> </td> </tr> <tr valign="top"> <td width="313">&nbsp;<img width="11" height="10" src="graphics/default/miscellaneous/weight.gif" alt="yük: 5" title="yük: 5">&nbsp; <a href="characterdetails.asp?action=viewitemdetails&amp;itemtypeid=168&amp;itemid=68615745&amp;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">&nbsp;<img width="11" height="10" src="graphics/default/miscellaneous/weight.gif" alt="yük: 3" title="yük: 3">&nbsp; <a href="characterdetails.asp?action=viewitemdetails&amp;itemtypeid=236&amp;itemid=100084253&amp;characterid=53845">kovboy çizmeleri</a> </td> <td width="140" align="right"> </td> </tr> <tr valign="top"> <td width="313">&nbsp;<img width="11" height="10" src="graphics/default/miscellaneous/weight.gif" alt="yük: 5" title="yük: 5">&nbsp; <a href="characterdetails.asp?action=viewitemdetails&amp;itemtypeid=168&amp;itemid=68615745&amp;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

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -