Javascript Tutorial – 5 – Prompt




Facebook – https://www.facebook.com/TheNewBoston-464114846956315/
GitHub – https://github.com/buckyroberts
Google+ – https://plus.google.com/+BuckyRoberts
LinkedIn – https://www.linkedin.com/in/buckyroberts
reddit – https://www.reddit.com/r/thenewboston/
Support – https://www.patreon.com/thenewboston
thenewboston – https://thenewboston.com/
Twitter – https://twitter.com/bucky_roberts

Original source


48 responses to “Javascript Tutorial – 5 – Prompt”

  1. I wanted to learn Java to program apps for android and I found it to be difficult. I wanted to learn how to design websites so I had to learn Javascript, which is why I am here. This ties up ALOT of the loose strings that I had in Java. They have alot of the same concepts. Thank you for your tutorials! I subscribed!

  2. var name=prompt("what is ur name?");
    alert ("hello" +name);

    output : hello abc
    [check box] Prevent this page from creating additional dialogs
    how to overcome this additonal prompt ?

  3. var f1=prompt("Your name please");
    var f2=prompt("Now your age");
    var f3=prompt("What is your favorite movie?");
    var f4=(f2*365);
    var f5=(f2*365/7);
    alert("Hello "+f1+", you are "+f2+" years old and you like the movie "+f3+". You were born "+f4+" days/"+f5+" weeks ago");

  4. //this is actually a usefull program. (note the e in the answer means "times 10")
    //the 5 in toExponential just means we want to show 5 decimal places of accuracy.
    var x = parseInt(prompt("What is your number? (bigger is better)"))
    var z = (x.toExponential(5))

    alert(x+ " in exponential form is "+z)

  5. @BraveMeat, well once you get your website online you would have to set up a cgi bin to collect the data and store it on your server. Then you can open up the file and see the data. This does require extra coding outside of javascript.

  6. The only problem with using parseInt means we're parsing an integer. So you can't do decimals.
    instead of using parseInt(prompt("Enter num1"));
    You can do parseFloat. This allows you to used values like 4, 0.5, and -34.5.

  7. If you agree that jQuery should be standard learning, please consider plussing this comment and help others see this link. : )

    watch?v=Hk5oXFtYLw

    "jquery for absolute beginners"

    but don't stop watching this series, either. You'll need both series. : )

    Libraries like jQuery and Prototype are the future of JS.

  8. Is it possible to do what you did at the end of the video with addition?
    I tried
    var num1=prompt("number one here");
    var num2=prompt("number two here");
    alert(num1+num2)

    Let's say num1 is 2 and num2 is 3, it comes out as 23. How to fix?

  9. Nice Video. I have a question though. As many of you have seen when you enter your routers home page (192.168.0.1 for example) a window appears that requires you to enter both user name and password. How does this happens? As i know you can have more than one input in a prompt

Leave a Reply