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 7957453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:15:06+00:00 2026-06-04T04:15:06+00:00

Sounds nit picky but this had me hung up for about an hour or

  • 0

Sounds nit picky but this had me hung up for about an hour or so.

I have a path set like this in JavaScript

const JAVASCRIPT =              'host/source/ArcJB.js';

which renders in my document like this:

<script type="text/javascript" src="host/source/ArcJ.js"></script>

If I put in a preceding / it breaks the link.

In PHP, for server-side paths I use:

<?php
    include_once getcwd() . "/host/source/class.ControlEntry.php";

If I don’t put in the / it breaks things.

I guess conceptually how am I suppose to know this so I don’t have to pull my hair out with trial and error?

Also noted:

Paths inside my .js file work with either a / or not a / preceding the path.

These are used for image lookup or ajax calls.

  • 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-06-04T04:15:07+00:00Added an answer on June 4, 2026 at 4:15 am

    Preceding slash is used to denote the path should be considered as an absolute path, which means,

    1. For your Js path, which resides in a HTML file which is parsed by a browser to render its content, it should append what you wrote to the domain to get the file. And if your Js file is located relatively to the current page your snippet is located, the link may break.
    2. For your php file, it is located in a path which can be accessed by following system root to host/source/class.ControlEntry.php
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This sounds like a newbie question, but I have a couple of Applications where
this sounds like a really simple question but could easily have a very complicated
Sounds like a weird question, but say I have something like this: $.post( /myajax.php,
This sounds like a really simple question, but I am new to PHP. If
That sounds pretty odd but i have this cod and i need to convert
This sounds like a stupid question but i can't figure it out for the
This sounds kinda dumb, but I have a sharded DB that I no longer
This sounds like a tricky question... let me ellaborate... I have a treeView. When
This sounds like a trivial question, but it's proved quite hard to google anything
This sounds like a contradiction in terms, or flamebait, but I'm hoping its not

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.