avols143 Posted June 24, 2015 Share Posted June 24, 2015 Hi. 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 kurstorg_pameld_oslo.html Link to comment Share on other sites More sharing options...
davej Posted June 24, 2015 Share Posted June 24, 2015 See... http://www.w3schools.com/jsref/jsref_obj_string.asp Also you should probably use this tool on the original code...http://jsbeautifier.org/ Then you will want to single-step through the code using browser developer tools, such as... https://developer.chrome.com/devtools/docs/javascript-debugging Link to comment Share on other sites More sharing options...
avols143 Posted June 28, 2015 Author Share Posted June 28, 2015 Thanks Davej for nice tips. But I question is what means by using ? sign and # sign in JS codes. ? sign means any char? # sign means only numbers? Link to comment Share on other sites More sharing options...
Ingolme Posted June 28, 2015 Share Posted June 28, 2015 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 "#" 1 Link to comment Share on other sites More sharing options...
avols143 Posted June 28, 2015 Author Share Posted June 28, 2015 Hi Foxy. Thanks for ans. Those signs used with IF statments if ((p=n.indexOf("?")) > 0 && parent.frames.length) if (a[i+1].charAt(0)=="#" Link to comment Share on other sites More sharing options...
Ingolme Posted June 29, 2015 Share Posted June 29, 2015 Is that a question? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now