Jump to content

Ingolme

Moderator
  • Content Count

    14,120
  • Joined

  • Last visited

  • Days Won

    76

Everything posted by Ingolme

  1. Ingolme

    its

    What is your question?
  2. You're passing a single string into gregoriantojd() but it expects three integers.
  3. Please keep your question to one topic. There is already a topic here: I have little experience with Laravel, but I'm sure a Google search would find something you could use.
  4. If you have a Content Management System (CMS), you will have to find or create a plug-in for the CMS that does that. If you don't have a CMS and there's no system for dynamically creating pages on your site then the sitemap will have to be created manually. Without knowing more about your website's back end I can't give a clear answer.
  5. You can add overflow to the w3-dropdown-content class and give it a max-height in order to cause the scrolling. On mobile devices, arranging the links into columns would likely get outside of the screen horizontally.
  6. You can put a unique class name on the <body> element of each page and have one CSS rule for each one. The other alternative is to load a page-specific stylesheet on each page, each stylesheet having a different body{} rule.
  7. The idea of a view-model is a slight alteration to the ordinary Model-View-Controller paradigm. First of all, to make things clear, there's no solid definition for what MVC is, it's just the idea of dedicating one of three different functions to each piece of your software. In the paradigms that contain a view-model component (I've seen the Model-View-ViewModel paradigm mentioned before), a view-model is a model that is attached to a view in such a way that an alteration to the model directly alters the view that it is connected to without the need for a controller to read the model and pass the data to the view.
  8. My guess is that the person who made the quiz considered "comment" and "multi-line comment" two different things, with "comment" only referring to the single-line comment. That seems to be the way it is represented in this chapter: https://www.w3schools.com/java/java_comments.asp
  9. It depends on the layout of your page. The link should align the top of the element with the top of the window. You might have more than one element with the same ID or CSS is causing the top of the element to be further down than its visible content.
  10. You probably should check the security settings of each of your browsers. Whenever the website makes a request for the location, the browser asks the user for permission. If this is not happening it's likely that the browser has been configured to reject all location permission requests. Each browser has its own permission setting, it is not shared across browsers.
  11. Ingolme

    Sean

    You will need to learn a server-side programming language. The easiest one to learn is PHP. Whichever language you choose to learn, it will not be anywhere near as easy as HTML.
  12. There isn't enough code here to determine exactly what the problem is. The code shown here would submit the page to itself and do nothing since there are no fields in the form.
  13. Javascript does not work in HTML includes, you have to load the Javascript sections including the onclick event from their own .js file using <script> tags.
  14. You might be confusing data storage with data representation. If you put a 10.00 in the database, it will store exactly 10, since the decimals aren't needed they're not shown. If you want to see the decimals, then your software will have to force a precision on the number when converting it to a string. I don't know what programming language you use, but it's up to the programming language to determine how the numbers are represented on the website or application.
  15. It's not possible with plain CSS. since the scrolling causes any overflowing content to be hidden. Javascript could do it if the vertical dropdowns are outside of the menu and moved into place with absolute positioning.
  16. The page doesn't describe what "Jekyll" actually is. Is it a programming language? W3Schools tutorials generally only makes tutorials for technologies that are used industry-wide. If they were to make tutorials for every obscure language and tool there would be thousands of tutorials and I don't think they have the time for it.
  17. Math.random() * 10 gives you a random number in the interval between 0 and 10. If you floor it, 10 will always be left out because random() never returns 1, leaving it at an even distribution between 0 and 9. If you add 1 to that the end result is a number between 1 and 10, so Math.floor(Math.random() * 10 + 1) is a valid way to fairly choose a number between 1 and 10. This excludes zero, if you want zero then you will have to include 11 in your equation and not add the "+1" Mozilla's example is just a more general solution for if you want control over the range, but if you replace max with 10 and min with 1 the formula still simplifies down to Math.floor(Math.random() * 10 + 1). I mentioned the problem with round earlier, but a graphic representation should make it clear. The distribution of the numbers on the number line for round is unfair. 0 1 2 3 4 5 6 7 8 9 10 Number line: |-------|-------|-------|-------|-------|-------|-------|-------|-------|-------| | | Math.round() |-0-|---1---|---2---|---3---|---4---|---5---|---6---|---7---|---8---|---9---|-10| | | Math.floor() |---0---|---1---|---2---|---3---|---4---|---5---|---6---|---7---|---8---|---9---| As seen above, the amount of the number line dedicated 0 and 10 is half of the other numbers and there are 11 possible output values for the function when you use round(). The code Math.floor(Math.random()*(max+1)+min), will not give desired results if you plug in 10 and 1. If you plug in those numbers, your formula simplifies to Math.floor(Math.random() * 11 + 1) which will give you random integers between 1 and 11. In summary, I believe that the W3Schools example is not misleading and is, actually, the only possible way to generate evenly distributed random integers between 1 and 10 in Javascript. Any other code that does that will end up simplifying to that same expression.
  18. You can click on the "Report error" button at the bottom of the page to let the W3Schools staff know that that page has an error.
  19. You only need to make one topic for your question. There are answers in your other topic. I'm closing this one.
  20. It's built using HTML, CSS and Javascript.
  21. The "+1" makes it as likely as the other numbers. If you use Math.round(), what you get is that numbers on both ends have only half the probability as the numbers in the middle, and in your example 11 would be the number at the end.
  22. CSS wouldn't be able to do it. You will need to do some math and write a Javascript program to determine where to place the image. It takes some work so there's no short code snippet that could be provided.
  23. They don't. There's a "report error" link at the bottom of each page if it has something incorrect or incomplete.
×
×
  • Create New...