Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. You can replace the < with &lt;. The message you're showing looks like it's from an HTML validator, not a browser.
  2. I cannot reproduce that in any browser. Are you sure you did not type those extra letters yourself?
  3. How far have you gotten and which part is giving you trouble?
  4. First, instead of setAttribute("draggable" ) you should set the draggable property of the element, as element.draggable = true. Once the element has been created, you have to call the dragElement() function to add the event listeners to this element. Without the event listeners the element cannot be draggable.
  5. Please don't throw the book away, donate it to a library or give it to somebody who needs it. I highly doubt that the book is so outdated that it it useless. Even if the book had some outdated concepts, programming theory doesn't change.
  6. getElementById() only gets one single element on the page. You will have to use a method that obtains multiple elements. You can't have more than one element with the same ID attribute.
  7. If you'd be willing to go through the effort, why not set up your own website to make Ruby tutorials?
  8. You will never be able to fix this until you understand the language. You should go through the full PHP tutorial from the beginning. It was mentioned before that the try statement should have brackets, and also that the try statement is useless in this context.
  9. For the record, PHP does not have access to the user's shell either. It only has access to the shell of the server that the website is running on.
  10. Javascript does not have access to the shell. That would make it much too easy to hack into anybody's computer from a web browser.
  11. You're also missing a semicolon ; at the end of this line: $result = mysqli_query($conn, $row) It seems like errors are disabled on your server, if you had them enabled the server would tell you exactly on which line the script stopped and why. While developing, you can add the following code to the beginning of your file to make sure error messages are displayed instead of a blank screen. <?php ini_set('display_errors', 1); error_reporting(E_ALL);
  12. Everything that comes from the database is also a string. If you want it to be an integer you have to cast it.
  13. If you truly have that many followers on those websites and are the director of technology at your company, you should take caution before taking such rash actions because your reputation is on the line. A majority of the people are going to look at what you're saying and conclude that you are an unreasonable person as you're complaining about something that is completely outside of the control of W3Schools.
  14. Ingolme

    Table Sort

    You haven't shown your code. You have to cast x.innerHTML and y.innerHTML to floats or ints before comparing.
  15. Your for needs a method="POST" attribute.
  16. If window and document are not defined, either you're not running this code in a browser or you've overwritten the window and document objects. "$" not defined would usually be caused by not including jQuery, or by having loaded jQuery further down the document than your code.
  17. Your code editor most likely has not encoded the file as UTF-8. Depending on which code editor you're using the way to do this is different. On Windows Notepad, there's an "encoding" dropdown in the same dialog which you should set to "UTF-8". Other text editors have encoding menus or an encoding option in the document properties.
  18. It means that document.querySelector("container"); is not returning an element. You forgot to use a class selector "." to select the element by its class attribute. For the second error, document.getElementsByClassName("container"); returns a collection of elements, not a single element. You have to select one of the elements in that collection.
  19. No, the problem is that you declared $result['rgb'] as a string ('rgb' => '') instead of an array, so it cannot have strings (such as 'r', 'g' or 'b') as an index. This would also be an issue in PHP 5, but you probably had the settings hiding the warnings.
  20. Ingolme

    Web Workers

    It's most likely due to browser security restrictions. Local HTML files are heavily sandboxed to prevent harming your computer.
  21. The ">>> 0" part converts the signed integer into an unsigned one, so that you can get the computer's actual representation of negative numbers. The ".toString()" part is the one that does the conversion to binary. When you put "2" as an argument it indicates that you want a base 2 representation, which is binary. If you gave it "10", it would give you the number in our familiar decimal system. For negative numbers, what you'll get is the way computers represent negative binary numbers. A negative binary number is represented by subtracting 1 from its positive value and then flipping all the bits, which means switching 0s for 1s and 1s for 0s. The reason they subtract 1 is because if they did not, there would be such thing as negative zero, which doesn't make sense in regular math. Keep in mind that this is only how computers represent negative numbers. In real binary a negative number is just a positive one with a "-" preceding it just as in the decimal system. If you want the mathematical binary representation then remove the ">>> 0" part.
  22. This does appear to have issues in Internet Explorer when using the scroll wheel on the mouse, most likely because the scroll action actually does a bit of backwards scrolling. To make it more robust it would probably have to keep a record of the last few scroll events rather than just the previous one.
  23. I just copied that code to a .html file on my computer and it seems to work correctly.
  24. Which try it code are you trying to copy which is not working?
  25. This looks more like Java than Javascript, but Java only uses single quotes for char type values, not strings so this wouldn't work in Java either. Which programming language is this?
×
×
  • Create New...