开发者

Applying javascript to website with appcelerator titanium

I'm try to use accelerator Titanium to add native commands to a webapp.

http://appcelerator.com/

I'm changing the window location to an external website like this:

window.location = http://site.com;

I want to bind events on that website.

$('a').click(function () {
  alert('cli开发者_Python百科cked');
});

The site has jquery loaded, the index.html also has jQuery included. But I suppose the index.html having jQuery has nothing to do with it since I changed the location already.

In any case the above does not work.

Can anyone tell me if it's possible.

To rephrase, what I want to do is use custom javascript and titanium commands on a website, sort of like a browser plugin?

Can anyone help with this?

Thanks.


If I understand correctly you want to do something like Greasemonkey does for Firefox. The problem is that you can not do such a thing because of browser restriction. What you are trying to do is the same thing as attackers do when they are exploiting XSS vulnerabilities.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜