Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4239968
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:06:15+00:00 2026-05-21T03:06:15+00:00

Writing an application for a custom gallery, and all the script files are put

  • 0

Writing an application for a custom gallery, and all the script files are put in a resource folder inside each gallery folder-

is it possible to have a variable enabled that would prevent the page from loading its local JavaScript files but instead load from the main page’s resource folder? trying to avoid having to hard-code it as well.

esentially all i really want is for my script files to be able to have a variable starting path- IE

(script src="(path)load.js" type="text/javascript")(/script)

where path is either blank “” or main main site- “http://www.site.com/resources/”

some of the files are CSS files so im not sure the class method would work well-
also- is there a way to refer to the root of a site? similar to using ../ but just to get the root html path.

More Info—–

The layout i have is that each gallery made is a separate folder- (for example, photography, painting, drawings, etc- would all be separate folders). They each would contain their own resources withing their folder. this is so i can just upload 1 gallery to a site and everything would be packaged nicely. But- if im running multiple gallery on one site- as with a portfolio site, each page is loading its own set of resources, which is probably not a great idea.

The resources are – thumbnails, images, xml( which are all specific to individual gallery) but then they also each have a couple javascript files for functions, a css file, and a few images that make the gallery maneuverable(arrows and the like).

I just want to be able to have the scripts which are loaded in the header- load from the root site resource folder if there are multiple gallerys

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T03:06:15+00:00Added an answer on May 21, 2026 at 3:06 am

    you can put all the code under a single class name e.g. Mydata.yourvariable

    and then check ..

    if (Mydata) { //your script has already been loaded }
    

    it’s similar to what jQuery does with $

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing an application that downloads large files in the background. All clients
My company is looking into writing a custom application that will need to perform
I am writing an application that integrates Geoserver with a custom component, intended to
I'm writing this application that will allow a user to define custom quizzes and
I am writing an application in BlackBerry, where I want to do some custom
I'm writing an application that sends files over network, I want to develop a
I am writing a python/pygtk application that is adding some custom scripts (bash) in
When writing application code, it's generally accepted that premature micro -optimization is evil, and
im writing an application that downloads and installs addons for programs which needs to
I'm writing an application that on some stage performs low-level disk operations in Linux

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.