0

I want to make a javascript file accessible from my web server.

So that anyone can access and reference it in their websites.

e-g Suppose abcxyzserver.com is my webserver.

www.abcxyzserver.com/Public/test.js

how can i make it possible that putting above link in the src of script tags will reference this js file.

1
  • 1
    Cannot understand where's the problem. If public directory it's not protected by a whatever authorization system, test.js will be publicly readable by anyone and usable as <script type="text/javascript" src="www.abcxyzserver.com/Public/test.js"></script> Commented Apr 27, 2015 at 7:41

1 Answer 1

1

You don't have to do anything special, just make the file accessible in the normal way, just like an HTML or CSS file. script tags aren't subject to the Same Origin Policy, which is why Google, Microsoft, and others can offer script downloads from their CDNs (just for completeness: Google's is here, Microsoft's is here).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.