Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial 4 - 2nd edition, unexpected output #422

Open
bigos opened this issue Mar 25, 2017 · 2 comments
Open

Tutorial 4 - 2nd edition, unexpected output #422

bigos opened this issue Mar 25, 2017 · 2 comments

Comments

@bigos
Copy link
Contributor

bigos commented Mar 25, 2017

section

To resemble the original JS code we also need to access the value property of the email and password elements. CLJS offers the .- special form for these cases as well: (.-property object):

cljs.user> (.-value (.getElementById js/document "email"))
""
cljs.user> (.-value (.getElementById js/document "password"))
""

Instead of empty spaces returns "[email protected]" and "secret"

@bigos
Copy link
Contributor Author

bigos commented Mar 25, 2017

I did not go to the next step where you have to enter the values. Did the downloaded code change?

@elenacanovi
Copy link
Collaborator

Hi bigos,

you get the empty lines

cljs.user=>  (.-value (.getElementById js/document "email"))
""
cljs.user=> (.-value (.getElementById js/document "password"))
""

if the fields email and password in the html page are not filled in.
Try reloading the html page and leaving the fields blank before calling the cljs functions in the repl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants