0

I'm creating a Google Chrome extension. I've done this before, anyway I'm trying to load a page and HTML from the page. Not trying ot display it, just trying to get a div's contents on the page.

$("a").click(function(){
    $.get('http://learntc.net', function(data) {
     var hatid = $(data).find('#ctl00_ctl00_cphRoblox_cphMyRobloxContent_txtStatusMessage');
    alert('Load was performed.');
    });
});

This, works. When I decide to to change the URL to http://www.roblox.com/my/home.aspx?ID=1 it breaks. This is the URL I'm trying to get data from.

I keep getting this error when I click the link though: Uncaught Error: Syntax error, unrecognized expression: Followed by the pages source.

Any help with this will be greatly appreciated.

4

1 に答える 1

0

私の知る限り、jQuery と JavaScript では、同じドメイン内でのみ .get() 関数を使用できます。そのため、他のドメインに変更すると、コードが機能しなくなります。

于 2013-03-14T02:14:49.413 に答える