Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. If the styles are applied by a CSS selector and after dragging the element the selector no longer matches the element then the styles will be lost. It would seem jQuery is stripping the ID attribute from the element when dragging it.
  2. You would need to make that in an image editor.
  3. The issue is this: foreach ($books as $key => $value) { print "<p>$key: $value</p>\n"; } $value is an array, not a string, so you can't just put it inside a string.
  4. HTMLCollection [ <a.attribute-value>, <a.attribute-value>, <a.attribute-value>, <a.attribute-value>, <a.attribute-value>, <a.attribute-value>, <a.attribute-value>, <a.attribute-value>, <a.attribute-value>, <a.attribute-value> This information you're displaying is just a short representation of the data in a node list. The node list is not text, it's an object with methods and properties. You need to use methods and properties to navigate and manipulate information in that node list. Try this code: // Get a collection of all the links var links = document.getElementsByTagName('a'); // Go through all the links we have collected and display information about them for(var i = 0; i < links.length; i++) { // Get one of the links in the list var link = links[i] // Show information about this link console.log("Showing link #" + i); console.log(" - Tag name: " + link.tagName); console.log(" - href: " + link.href); console.log(" - class: " + link.className); console.log(" - Text: " + link.innerHTML); console.log(" "); }
  5. Ingolme

    w3.css

    Of course. Just be sure to include it after including the W3.CSS stylesheet so that it has higher precedence.
  6. The file you've attached works without error when I tested it. There might be some strange server-side caching going on in your server. Try renaming the file and running it.
  7. You might as well attach the whole document so we can look through it. Make sure it's the most recent version.
  8. You are supposed to know the ID of the element you want in advance. Which ID do you want to get? There are many IDs on the page, if you don't know which one you want, then what are you trying to achieve?
  9. You want to get an element by its id. What is the id of the element you want to find? If you do not know the id, then you cannot find the element using this method. "Get Element By Id" is equivalent to "Find Person By Name". If you do not know the name, you cannot find the person.
  10. Ingolme

    mysql ditching

    It means Red Hat has stopped using MySQL and decided to use MariaDB instead.
  11. Are you sure that the error is pointing to those lines of code? The problem must be somewhere else in your document.
  12. Just copy the few lines of code that the issue is on and post it here.
  13. The issue is that every single opening parenthesis needs to have a closing parenthesis before the curly brace.
  14. You have mismatched parentheses. if ( is_numeric($_POST['year']) AND (strlen($_POST['year'] == 4) ) { I don't think "AND" is a valid keyword in PHP. You should use &&.
  15. Ingolme

    mysql ditching

    I don't know. You have not shown me any context.
  16. Sometimes people comment out pieces of code they think are no longer needed but might want to use in the future. Things between <!-- --> are not shown on the page. In this particular case, some of that code is only meant to be shown in Internet Explorer. document.getElementById('ie7') returns null because at the moment of execution the element did not exist on the page. document.getElementById('all-css-0') returns an element. The element is everything you saw in the console. That's what an element is. If you don't want an element then don't ask for one. getElementById() finds an element that has an id attribute with the value you specified. If all you want is the string "id='all-css-0'" then just type that: var whatIWant = "id='all-css-0'"; I cannot understand your last question. What you're asking does not make any sense.
  17. If there is no ID you'll have to traverse the DOM tree in some other way. There's information about this in the HTML DOM tutorial. It's long and complicated, so read carefully.
  18. Ingolme

    mysql ditching

    http://www.dictionary.com/browse/ditch?s=t
  19. Ingolme

    mysql ditching

    I've never heard of it. Where did you hear that? They probably meant to say they're ditching MySQL in favor of some other database.
  20. Are you getting any error messages?
  21. You either want a delay or you don't. If you're asking for the result to appear in one second then you want a delay of one second.
  22. As of HTML 5, the <head> and <body> tags are not required, though it is still preferable to put them.
  23. I would not trust that functionality. According to MDN the "event" variable is local to the attribute's scope. https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Event_attributes While the event variable may be global in some browsers for some reason, I don't believe you can trust it to always be there. It may not be available in all browsers and on browsers where it is available it may disappear after a browser update
  24. That's a behavior I did not expect, except in Internet Explorer. Internet Explorer has a global object called event on the window object, or at least it used to. I'm not sure if they've removed that feature in new versions, after all it is not standard.
  25. Inside the event attributes, when an event is fired it will pass an event object with data about the event. It's not global, it's local to the block of code inside the event attribute. In ordinary Javascript, that's equivalent to the "e" in element.ondragstart = function(e) { } Personally I believe W3Schools should not be teaching people to use attributes for events. They should teach addEventListener() and the older standard event model with events as methods of the object.
×
×
  • Create New...