Jump to content

nhuyvan1106

Members
  • Content Count

    17
  • Joined

  • Last visited

Community Reputation

0 Neutral

About nhuyvan1106

  • Rank
    Newbie
  • Birthday 06/11/1992
  1. Hi yo, same here, I just didn't discover the deep PASSION for programming after I got fired from Amazon( , I am really glad that happened even though I was really depressed, if it had not, it would have followed the auto mechanic path which would be very different), but anyway, I had the same questions as you do also, and I am just 23 like you are too , I started out with HTML, CSS, then JS, but that is not enough though, I am now teaching myself java (and android programming) which is really frustrating to learn yourself, but like I said, PASSION, it helps me overcome my frustration(I even h
  2. Oh yeah, mannnnnnnnnn, that makes alot of sense, because setInterval() doesn't cancel itself out like setTimeout() does, so it will keep calling itself multiple times during 1-second interval really lightning-fast, that is why the number appears to be skipping over, man, thanks alot for saving me a headache.
  3. <!DOCTYPE hmtl><html lang = "en-US"> <head> <meta charset = "UTF-8"> <script type = "text/javascript"> window.onload = myFunction; var i = 11; function myFunction() { document.getElementById("output").innerHTML = display(); setTimeout(myFunction, 1000); } function display() { i--; var prompting; if (i == 0) { i = 10; prompting = confirm("Do you want to go?"); if (prompting == true) { window.location = "http://www.google.com"; } } return "You will be re-directed in " + i; } </script
  4. Thank you Don. Yes, I have thought about that, but it is too superfluous. Ingolme's idea is really awesome. That's what I was trying to look for. Excellent. Thank you so very much guys. Your help and time are not forgotten.
  5. <!DOCTYPE html><html lang = "en-US"> <head> <meta charset = "UTF-8"> <style type = "text/css"> fieldset { width: 850px; margin: auto; text-align: center; } #txtField { text-align: center; } #tryAgainBtn { display: none; } </style> <script type = "text/javascript"> window.onload = myFunction; var randomNumber; var outPut; function myFunction() { randomNumber = Math.floor(Math.random()*1000); document.getElementById("checkBtn").onclick = checkAnswer; document.getElementById("tryAgainBtn
  6. <html><head><script type="text/javascript"> function showPosition() { var oElement = document.all.oCell; var myDiv = document.all.myDiv; alert("The span element is at (" + oElement.offsetLeft + "," + oElement.offsetTop + ")n" + "The offset parent is " + oElement.offsetParent.tagName + " offsetHeight is " + oElement.clientHeight); } </script></head><body onload="showPosition()"><div id = "myDiv" style = "width: 100px; padding: 10px 20px; position: relative; border: 1px solid black;float: right;"> <span id="oCe
  7. Hi guys, I just have a dumb question but looks like I can't find the answer anywhere at all. What is a global function? specifically, how do I determine the scope of a function? I know the definition of the variable scope, but function scope, I don't, hope you guys could clarify this for me. One more thing. I have this code down below about the "this" keyword. Doesn't the "this" keyword refer to the element that triggers the event? if so, why it pops up "undefined" when I click on the paragraph? I'm pretty positive "this" in my case is bound to a global variable(that's why it gives me an "
  8. Ah, ah, after hours of fiddling with this, finally got this figured out , hard work always pays off as always feeling so amazing, thanks a bunch guys.
  9. <!DOCTYPE html><html><head><script>function myFunction(e){ alert(e.target.id);}</script></head><body><p id = "myBody" onclick="myFunction()">Click on a paragraph. An alert box will alert the element that triggered the event.</p><p><strong>Note:</strong> The target property returns the element that triggered the event, and not necessarily the eventlistener's element.</p></body></html> I attempted to do this as you can see, but the handler won't do anything, what am I still missing here guys? Thank you
  10. <!DOCTYPE html><html><head><script>function myFunction(e){ alert(e.target);}</script></head><body onclick="myFunction(event)"><p>Click on a paragraph. An alert box will alert the element that triggered the event.</p><p><strong>Note:</strong> The target property returns the element that triggered the event, and not necessarily the eventlistener's element.</p></body></html> Hi guys, I am really struggling with this right now, please help. As you can see the above, I don't really understand these lines of co
  11. Man, that makes alot of sense. It is hard sometimes when you are teaching yourself something, Im glad I found this forum and website. Thank you very very much Foxy mod, you don't know how much I appreciate the help, god bless you. Cheers
×
×
  • Create New...