javascript - .find Inquiry about how to find text -



javascript - .find Inquiry about how to find <a> text -

how find text on page under tag?

i tried this, didn't work:

var link = "http://www.roblox.com/my/groups.aspx?gid=34039" function her() { $.get(link, function (data) { if ($(data).find('no one!').length) { post() lol() } }) } her()

if retrieving info html can line below

// below illustration statement find anchors has no one! text var phrasetofind = "no one!"; //links contain above phrase example. var isanylinkwithphrasefound = $(data).find('a:contains('+ phrasetofind +')').length > 0;

your function alter below:

function her() { var phrase = "no one!"; $.get(link, function (data) { if ($(data).find('a:contains('+ phrase +')') .filter(function(){return $(this).text() === phrase }).length) { //this filter give links exact phrase post() lol() } }) }

javascript jquery post get

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -