Added: 4 years ago
From: thenewboston
Views: 65,878
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (119)

Sign In or Sign Up now to post a comment!
  • 240p has never been so GOOD!

  • @toobywedge well I'm only 11 haha, but I should be measured as 17...

  • Here's a cool little multiplying app I made with the stuff Bucky said:

    var name=prompt("What is your name?");

    var num1=prompt("Enter a number");

    var num2=prompt("Enter another number");

    alert("Your aswer is "+num1*num2+", "+name);

  • 42 ftw!!!

  • His real name is Greg Roberts

  • ("Is that a "+obj+" in your pocket or are you just happy to see me?")

  • great tutorials - many thanks Hoss

  • //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)

  • var name=prompt("what is ur name?");

    alert("fuck you "+name);

    :P

  • Ok, It's very good to learn JV tutorial here on youtube.com. Thanks Mr.Scott

  • Case *,-,/ is very good but case + doesn't work!

  • When I do addition, It doesnt add the two numbers, it just puts them next to eachother. Any help?

  • @austin10123 same thing happens to me :(

  • @austin10123 try tis...

    var num1= prompt("enter your first number"); var num2= prompt ("enter your second number");

    alert(Number(num1) +Number (num2));

    Hope tis help u :)

  • JavaScript uses the same logic as Java!

  • @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.

  • 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.

  • So if i create some fake website and i do javascript prompt for the victim to enter the password.Will it he save the password?

  • the prompt command doesn't work for me.

    prompt("What is your name?");

  • i love javascript and im only 14

  • @gmaninthusa i love javascript and im only 12

  • @gmaninthusa I love javascript html php css vb6 C++ and html and i am only 14!

  • @stumblinbear I'm 16 and I love them too ^^

  • I absolutely love your tutorials! They are so easy to understand. I am 14 and have been trying to learn javascript for 1 or 2 years with no success, but these have helped so much! THANK YOU!

  • very very very and very thanks:)

  • 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.

  • how do i get rid of the crlf thing?

  • Amazing tutorials Bucky!

  • Nice and simple!

  • 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?

  • @T1melimit Well, it prints 23 instead of 5 because prompt returns a string of text not an integer. I'm sorry, but I don't know how to fix it.

  • how do i do that but with adding?? its reading my + sign as a "and" for example i type in 2 + 2 javascript reads it as 22.

  • @peterhea222 (2 + 2)

  • @francisvolley yes that is what i did i wrote it exactly as (2 + 2); thankyou for responding back but idk why its still not working

  • @peterhea222 check xxmikescottxx comment

  • var name=prompt("what's your name?");

    alert("hello "+name);

    alert("want to see some magic "+name+"?");

    var num1=prompt("ok "+name+".. put any number that you want");

    var num2=prompt("good. now, put here another number");

    alert(num1+num2+"... magic?..");

    try this and be amused :D..

  • great tutorial. How can I add to variables. us said num1*num2 but if you type in num1+num2 you get these two numbers in row.

  • @mimpf96 alert((num1+num2));

  • i see u all Js totorial and i like that all

  • 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

  • @xXMikeScottXx -  hey thanx bro! for that "parse" thing. Liked it

  • Thank you so much sir. Great tutorials for a beginner like me.

  • Mike Jones Who?Mike Jones Who?

  • @9xDEAD Mike Jones you! =) Let's have gay buttsex no homo.

  • mike hawke

  • very easy to follow. thank you very much for your tutorials.

    i'm gonna continue watch all parts.

  • How do you create a radio button in javascript?

  • Mike Jones?  Classic.

  • @thetaye That's my uncle's full name O.o

  • The " + " function does not work with your math example. It adds the numbers as a string. Any way to get around this? 2+2 ends up being 22.

  • @mysg4ever put (2+2) that works

  • thanks it helps mutch more than thousands of other videos on youtube that wont teach you anything at all

  • Comment removed

  • ("Hello "+name+" you have a horrible name.")

    This is what he meant to put on the video.

  • Thanks dude now my webpage says Whats your name? Web I put guest, it says Hello Guest!

  • Java is so easy duh x_x

  • @TheRealAuxiliary this is javascript

  • who? Mike Jones who? Mike Jones!!

  • great for beginners

  • I am a freshman in Computer science and these videos have been of great value! Thanks for all your effort! Keep it up!

  • what is easiest to learn javascript html or php

  • @zlakieprograming I feel HTML would be the easiest. But I have no idea how PHP is.

  • @zlakieprograming it's always good to learn from books for best coverage of knowledge. Web tutorials are mostly just quick info and tips. W3school is a great place to learn all the features of all web languages.

  • thanks so much

  • what if you wanted to do something were it would say something like hello "+name glad to meet you. because I was wondering how, if u can, make the rest of the words after "+name apear on the page.

  • ("hello "+name+" glad to meet you");

  • Another great tutorial!

  • @Chopinsiblos.

    You are using the + operator in ur variable that is why you are getting 11, it is just adding 1 to 1, you want to use the * operator.

  • Comment removed

  • @mitcoz2 no * is for multiplying. chopinsibols wants to add e numbers

  • your tutorials are the best, but 1+1 is 11...how could i solve that problem? thanks in advance..God Bless..

  • the prompt returns the message as a type "string". So it treats the input the same way as it would text. You cant "add" strings, the + operator concatenates them, adding them to the end of each other. To output the sum of 1 + 1, you need to state that they are of number types.

  • try this...

    var num1 = parseInt(prompt("Enter num1"));

    var num2 = parseInt(prompt("Enter num2"));

    var answer = (num1 + num2);

    alert(answer);

    now the input is "parsed" as an integer rather than a string. Google javascript to string for more information.

  • @xXMikeScottXx he didn't have to parse it... and it worked.

  • @monofono2006 Because he multiplied it. If you're trying to add them together with the "+" symbol, then it will literally add them together. If you put "5 + 6" the result will be 56. This is because it's being read as a string instead of an integer.

  • @xXMikeScottXx I get an error everytime I try this :(

  • Comment removed

  • Comment removed

  • hey u r amaizing person

    god bless u and ur family

    but what is notepad++

    i have normal one and i want to get the same software u have.

  • It alsow uses if else statements

  • Im working on a question game that uses prompt and alerts so I need to watch JavaScript.

    P.S

    Your tutorials on JavaScript are the best!!!!

  • That was some awesome vid you had!

  • if you type (num1+num2);

    it puts the two number together like 1 + 1 = 11

  • That's if num1 and num2 are strings. If you want to add the numbers in strings you can do: parseInt(num1)+parseInt(num2)

  • I'm taking a course and I don't know what the hell my teacher is doing. But you make sense. Thanks.

  • Wow, you make things MUCH easyier! I rated and subscribed!

  • Mike Jones lol

  • your website is down

  • its just like a video now?

  • Thanks

  • keep doin wat ur doing.Its really helping.

    Thanks alot

  • well threre are some bugs im working on because when you actually type the second sector of coding lines for example

    the first line lets make it: var num1=prompt(num----blalalblal

    but then when you try to repeat the same code but with difrent sing for example / division / multiplication * or any other sing it give syou false numbers im try to fix it so that way all bugs will be gone lol and hey keep up the good work nice vids by th way

  • actually if you type alert (num1*num2);

    alert (num1+num2);

    alert (num1/num2);

    what it dows is that it gives you the results for the adition because we put a + sing and division because we also put a / sing

    its preatty awsome

  • What's to keep the user from entering a string of text instead of a number?

  • Hey, i find your videos really helpful. thanks alot

  • it doesn't seem to work if you use +

  • use this:

    alert (Number(num1) + Number(num2));

    should work fine...

  • how do you make a regular message to the use without the "script prompt to do it?

  • do u know how to work java script for SAM Broadcaster 3

  • great video man

  • thanks ill try posting some more tutorials this weekend!

  • I look forward to watching them =]

    I have been trying to learn JavaScript I have a book on it but I hate reading lol

  • @thenewboston Hey I have a good question! Did you code your website? :D

  • how do i change the header of the alert box?

  • it also says it on the alert box

  • i don't want it to say "JavaScript Application"

  • Good stuff especially for beginners keep up the good work!

  • The problems with these tutorials is there is so much more you can do with this but they dont even mention it.

  • it covers the basics though.

  • You got me curious. What else can you do with these? Would you be willing to make some tutorials, that would be awesome!

  • HA if only i had the basics down. Im okay. But not the best. No where close to being ready to make tutorials.

  • if u put if (name!=null && name!="") it wont accept u to write nothing so that is a very good thing to put in to

    otherwise it might try to say nothing and that is a waste

  • Dude,

    This is great stuff.

    You are a natural teacher.

    Please keep making tutorials.

    Many thanks!

  • can you show me how to use prompt in forms?

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more