I have a domain A with javascript file. And I have also domain B which includes domain A's javascript with <script type="text/javascript" src="http://a.com/file.js"></script> But it currently gives error, because access denied. How can I tackle this? Google use this when displaying adsense. Why can't I do it?
You should post this in the Javascript section. And show us the exact error you get. Usually there shouldn't be a problem. (Post also file.js)
If file.js involves AJAX, browsers forbid doing an xmlhttprequest from another domain for security reasons. You have to keep it on your domain. Normal javascript will work fine across domains though.