You know the standard JavaScript include in HTML?
<script src="http://example.com/script.js"></script>
How can I post data to that src
? Using AJAX or jQuery is probably not an option, unless you can get it to work cross-domain.
You know the standard JavaScript include in HTML?
<script src="http://example.com/script.js"></script>
How can I post data to that src
? Using AJAX or jQuery is probably not an option, unless you can get it to work cross-domain.
You can't post data and retrieve the content cross domain. It's a security issue.
You probably already realize this, but you can do GET requests by appending it to the url:
<script src="http://example.com/script.js?key=value&key2=value"></script>
You could also use a proxy to retrieve cross domain requests from a site. This project looks promising: https://github.com/jamespadolsey/jQuery-Plugins/tree/master/cross-domain-ajax/
But it appears to also only support GET requests through yahoo's server.
The only viable option is create a php(other other sever languages) proxy that you could filter through. It wouldn't be to difficult using php's curl
API. There are equivalents in other server scripting languages.