Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. It works like any other selector, the same CSS precedence rules apply. It just adds the specified style to all elements on the page. In the specific example you gave, the box-sizing property needs to be applied to all of the layout elements on the page. You should read about box-sizing.
  2. It's not simple, it requires a bit of thinking and work. The first step is to convert the current array to postfix notation. Once you're in a postfix notation, the algorithm to perform the calculation is simple.
  3. You're disabling the button right when it is clicked, so it won't make the form submit, but if you don't disable it then the form will submit, leaving the page and resetting the button states anyway. What is your end goal with this?
  4. It's called the universal selector. It applies the specified style to all elements on the page. Personally, I think it is better not to use it.
  5. Set the value property of the textarea to an empty string when the button is clicked.
  6. If "logview1" was a textarea, the code you have right there would work just fine.
  7. You need a <textarea> element for that. <input> elements only support single-line text.
  8. You can either do that through your FTP client, or if you need it done automatically you'll need a server-side programming language.
  9. Personally I feel like this whole thing is overcomplicated. Is there a reason why you can't instantiate an ordinary PHPMailer, set a subject and body and send the mail? It's about 5 lines of code.
  10. I would sooner use the insertBefore() method so as to not change so much of the DOM at once.
  11. I've never used traits in that manner before, so I can't be sure if PHP lets these mistakes through, but I am expecting a parse error or syntax error due to there being logic directly inside the class definition. A class definition cannot have any if() statements, loops of any kind or function calls outside of the methods. The thing with traits and all other object-oriented features is that they have to be clearly established before the code starts running. Before you begin writing your code you clearly define each of the classes and their relationships with other classes, interfaces and traits. You don't choose at runtime which trait your class is going to use, your class was either defined with a specific trait, or defined without the trait. Traits are also not necessary if only one single class is using them, just put the trait's features right into the class definition itself.
  12. The phone's resolution is actually 1080x1920, but the viewport tag tells it to pretend that its resolution is smaller so that things are easier to see. This is called a device-independent resolution, because regardless of which device the user is seeing, the things have approximately the same apparent size.
  13. What code is putting the errors onto the page?
  14. All phones have a device-independent resolution smaller than 768 pixels, even if their physical resolution is much higher. You must use a meta viewport tag in order to get the phone to use its device-independent resolution.
  15. Does that code work when you run it?
  16. You can't create a hit counter if you don't know what a hit is. You have to define this first. Once you have a definition, you can build something based on it.
  17. The problem is that you have to clearly define what you mean by a "hit". Do visits to two different pages add to the same counter? Does the same person refreshing the page 5 times count as 5 hits? Should visits from search engine crawlers count as hits?
  18. W3Schools has since moved Web Services into the XML tutorial. I've updated the link.
  19. Actually, the main issue here is that there is no onchange event on div elements. You're either going to have to run a script periodically to check for changes or have a button that the user clicks to fill in the textarea. Either one of those two solutions would have to call a function like this one: function updateTextarea() { document.getElementById("signature_svg").value = document.getElementById("signature").innerHTML }
  20. When you append a node to the textarea, it doesn't show anything, because the textarea only shows what is in its value attribute. Instead, you can do this: document.getElementById("signature_svg").value = datapair[1];
  21. There's no problem with whitespace in the code itself. What I do find is that in your first post, you forgot to quote :itemandsize string.
  22. Access the currentoutput1 element and set its value property to whichever number you want. document.getElementById("currentoutput1").value = ...
  23. Without the HTML structure it's hard to tell what's going on there, I can only make guesses. The <span> element cannot contain a <p> element, use <div> instead of <span>. Try setting the margin of the <p> element to zero.
  24. Ingolme

    Onclick event

    For reference, templates are described here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
×
×
  • Create New...