New thread
Forum
Level Discussion > Javascript Levels > Javascript Level 3 > Latest threads-
ThreadRepliesVoicesLatest
-
-
even with a js it don't worki think i did everithing right (typed javascript:alert(code) in the adress bar but it do not work at all..neeed to understand the logic of this one thanx ;)12
-
105
-
What am I doing wrong here?!First of all, I never studied javascript... now that I think of it I just kinda "know" programing languages (strange but thats not the point). So I see this script: Spoiler: <script type="text/javascript"> var thecode = 'code123'; $(function(){ $('.level-form').submit(function(e){ e.preventDefault(); if ($('.level-form #pass')[0].value == thecode) { document.location = "?pass=" + thecode; } else { alert('Incorrect Password'); } }); }); </script> And as a logical person I see that it looks like php, a language I happen to know quite well. So I dissect it: Spoiler: var thecode = 'code123'; this gives me the thought that it is the password itself but cannot be sure. Spoiler: (function(){ $('.level-form').submit(function(e){ e.preventDefault(); This line, I assume this is meant to detect when I press the "submit" button and trigger the script. Spoiler: if ($('.level-form #pass')[0].value == thecode) This one is quite obvious, if the password I entered is thecode or in other words "code123" Spoiler: { document.location = "?pass=" + thecode; } else { alert('Incorrect Password'); } }); }); If the above is true than I should be forwarded to ?pass=code123 but instead I just get the error alert. Spoiler: So I tried making the GET request manually but no luck https://www.hackthis.co.uk/levels/javascript/3?pass=code123 What did I do wrong?!?!137
-
116
-
[closed] Console.log acts weird, probably not on the right track, just curiousHey everyone, I just got stuck at this level and tried to debug and see if the value in the checkbox gets modified after I press submit. To see the value at first, I did this: [code]if ($('.level-form #pass')[0].value == thecode){console.log("correct")} tcerroc[/code] So, theres a lrt/rtl translation, but the mentioned file "main.js?1446747682:289" only says "reverse console.log blaaa". Can you confirm that this is not relevant to the challenge? Looks a bit weird to me :P32
-
Issue on Firebug with firefoxWhen trying to add the relevant alert after the "incorrect pass" alert, using firefox's firebug it seems that the modified script gets reevaluated. This causes "code..." to be a valid password for the JS (but of course, not for the PHP). The series of alerts caused by this is a bit strange ("wrong pass", "wrong pass", "[empty]", "wrong pass", "code..."), but anyway they give no clue of the needed password for the PHP. I managed to work around this by downloading the page and changing the actual source, but people using firebug (and any other tool which reevaluates the modified script) will indeed not be able to find the needed code using an alert in the submit function's code. And that might be the source of the difficulties people describe regarding this level. A simple fix for that would be separating thecode's assignment to an inline script of it's own, above the script it is currently included in.33
-
[closed] Problem with the level?I have tried many many things with the javascript code above the form and no matter what I change it does not do anything different. I have even commented out the entire javascript tag and content and all it still just gives Alert box with 'Incorrect Password' I downloaded the page source and saved it as a .html file and it works perfectly. I enter the password found in the code and it changes the url as it is supposed but it does not do anything on the site. Is this an error in the page or am I just going crazy lol. If it isnt the level just tell me and I'll have at it again. Thank you for all your time and assistance. HackThis.co.uk forever! I don't see any links in the source anywhere pointing to external .js files to handle the level either.22
-
problem?I used javascript: alert (*******) and ... nothing, not even a warning. Any idea?22
-
3525
-
[closed] is there something wrong!!I got the password, and without reading other thread, because I'm sure it's correct, but when I clicked "submit" it give me "incorrect pwd"!!!83
-
- New post
- New post in watched thread
- Thread closed
- Sticky thread