Use GM+JQuery to get all anchor in a page

24 views
Skip to first unread message

Vistac Wu

unread,
Dec 8, 2011, 11:46:57 AM12/8/11
to greasemon...@googlegroups.com
Hi all,
I have a strange problem,
I want to use jquery to get some specific link in a page,
but I found a strange problem, I don't know what happen.

I put maybe 10 anchor tag in my test page, I just put a simple script like below
alert($("[href]").size());
I can get the response of 10,
but I put the same code in my target page GM script,
I can't get any thing, it always response 0,
then I try
alert($("div").size())
it also response 0,

I checked the target page by view source,
I'm sure that a lot of div or anchor generate by plain html text, not by script.
I also can use $("body").append("<input type=button>") to create a new button.
seems only use css selector to get tag failed, why?
I use jquery 1.7.1
sorry for my poor english,
hope someone can help me.
thanks.

Reply all
Reply to author
Forward
0 new messages