I have a Javascript that I want to access from several different web pages.

I want to locate the .js file in the web root (httpdocs) folder and access it from different webpages in sub folders. I've tried setting the src attribute to the URL of the web root but without sucess.

Is it possible to do this and if so how please?

Recommended Answers

All 2 Replies

I'm trying to understand what problem you have. Are you saying that you don't know how to format the "script" tags? Or that you don't know what to put in the "src" for the tag?

It was the latter but ive solved it with .\ should I use the full url?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.