views:

205

answers:

2

Hi. I've built a Bookmarklet based on Ben Almans jQuery enabled Bookmarklet.

The bookmarklet creates a an fills it with some data from a $.get('http://mydomain.com/request/') Request.

It works as long as I am on the same domain, but if I try to run it on another site, e.g. google the $.get() does not work.

I've also tried $.getJSON() and $.post(), but nothings seems to work. Hoping, that anyone can halp me!

(Please excuse my bad English, I am from Germany and 16 years old ;)

A: 

Hi,

Ajax isn't cross-domain by default, so it'll only work within your domain.

However, you got some solutions. One is using curl with jquery ajax to get what you want, other is use a library like this one : http://www.ajax-cross-domain.com/

yoda
Thanks, I'll check this out.
A: 

You won't be able to do this for security related reasons. An option would be to turn your web server into a proxy.

Andy Gaskell
Thank you.I am not sure, if works to turn my web server into a proxy.Because if I run the Bookmarklet from another website than my own, the proxy is on another domain and will not work.Am I right?
@Philipp yes that's right - the proxy has to be on the same domain
Greg