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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:10:05+00:00 2026-05-23T12:10:05+00:00

Over 1 hour on this. This is javascript code inside my index.php file. function

  • 0

Over 1 hour on this. This is javascript code inside my index.php file.

function dostuff()
{

   var thepath = document.location.search.substring(1);
   alert('the path is ' + thepath + " (that's the full path)");
   alert(thepath);

       // TRIED THESE ALL -- NONE OF THEM WORK.
   //var pathLen = String.length("thepath");
   //var pathLen = String.length(thepath);
   //var pathLen = thepath.length();
   var pathLen = String.length(document.location.search.substring(1));
   alert('pathLen is ' + pathLen);
}

The symptom: the first 2 alert boxes appear no problem and both show ‘thepath’ has a valid pathname in it, and it is the correct, expected path too.

But no matter what I try — see the 4 different attempts, tried one at a time — the final alert() box NEVER shows up.
Why is alert(‘pathLen is ‘ + pathLen) not showing up?

(The other thing is — I’m using XDEBUG and xampp and Netbeans and the debugger will not let me put a breakpoint in this javascript code, so I can’t even step into it to see what’s happening, hence the use of the alert()’s in the code. I know the XDEBUG debugger I’m using in Netbeans works — I’ve been using it all night to debug PHP code in a different.PHP file. When I set a breakpoint though in any Javascript code, a ‘broken breakpoint’ icon appears and I cannot find what that means in Netbeans documentation.)

  • 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-23T12:10:05+00:00Added an answer on May 23, 2026 at 12:10 pm

    I’ve never seen that syntax before. You might want to try:

    var pathLen = thepath.length;
    

    (You’d be best off debugging with Firebug)

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

Sidebar

Related Questions

I have been looking over this code for the past hour, I cant see
I've been messing with this bit of code for over an hour trying to
I've been scratching my head over this for an hour... I have a list
This sounds stupidly easy, however I've been googling for over an hour and I
I have honestly looked for over an hour for a satisfactory answer to this
Having just spent over an hour debugging a bug in our code which in
I'm desperate having spent well over an hour trying to troubleshoot this. I am
I've been trying to solve this problem for over an hour now, and can't
This one has been giving me fits for over an hour... I could swear
Really odd experience with this which took me over an hour to figure out.

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.