Jump to content

Use of indexOf("?") and charAt(0)=="#" in JS


Recommended Posts



I am new here and new to javascript :) Can som one help me to understands some codes?



if ((p=n.indexOf("?")) > 0 && parent.frames.length)


if (a[i+1].charAt(0)=="#"


See the attached file for details.


1. What means by question mark # and a number sign # in if statments above?


2. I want to remove check on first field mamed "Elevnummer" and from radio option.


3. How can I output the values of the objects


thanks :)



Link to comment
Share on other sites

No, it's literally looking for a "?" or "#" in the string. I haven't read the full source code, but I assume it's looking for the query string and hash in the URL. These are the parts of a URL:http://www.example.com/path/file.html?a=1#extra-dataProtocol Host name URI query string hash The query string always starts with a "?" and the hash always starts with "#"

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...