Jump to content

Ingolme

Moderator
  • Posts

    14,894
  • Joined

  • Last visited

  • Days Won

    176

Everything posted by Ingolme

  1. The ID is case-sensitive, so differences between uppercase and lowercase letters will cause problems. Make sure that the element's ID and the one in the function call are identical. The <iframe> HTML is also invalid, so the ID might not be registered properly by the browser.
  2. A database is not required but recommended. You could just write the data into files on the server's filesystem. The most commonly used databases use SQL, but there are alternatives. Anyway, it would be good to learn SQL.
  3. I recommend doing the tutorials in the order HTML > CSS > Javascript. If there's something you don't understand you can always come back to review it later. This kind of knowledge builds up gradually over time.
  4. You don't seem to have a full grasp on how Javascript works, I recommend spending more time studying the Javascript tutorial. The second example is more correct, but you're making things confusing by assigning two completely different things to the same variable. "iframe" is a variable and you could name it anything you want and assign any value to it. I would recommend, to prevent things from being confusing, that you only assign an actual iframe object to it and not anything else like "outerHTML" which is just a string. The actual reason that the second block of code is not working is that HTML <iframe> elements don't have a "document" property. You can see the list of properties that the iframe has in this reference page: https://www.w3schools.com/jsref/dom_obj_frame.asp Using the reference page shown above to determine which iframe property will solve your problem.
  5. The variable iframe hasn't been declared. You should assign a reference to the <iframe> element to it, for example: var iframe = document.querySelector("iframe");
  6. Ingolme

    Translation

    If you see any mistakes on a W3Schools page anywhere on the site, you can click the "REPORT ERROR" link at the bottom of the page. The website staff are not active on the forums.
  7. Using columns will always order things vertically. If you want them lines up horizontally try a flex-box instead of columns. W3Schools has a few tutorial pages describing how to use flexbox: https://www.w3schools.com/css/css3_flexbox.asp
  8. Neither of those guarantee that the link won't be crawled. Crawlers are pretty intelligent these days. If you don't want your link crawled, add a rel="nofollow" attribute to the <a> element.
  9. The first statement is correct. The following code outputs "ld!" var str = "Hello world!"; var res = str.substr(-3); console.log(res); The other statement should be revised to "If start is negative and larger than the length of the string, start is set to 0" The fastest way to report errors to the W3Schools staff is to click the "REPORT ERROR" button at the bottom of every page, since they don't actively participate in the forums.
  10. Dropbox creates a folder like that for you if you download its desktop application. I don't know about the other services.
  11. At which screen resolution should it reach 90%. You can use a media query to set it to 90% at a certain screen size. Percentages are always relative to the screen size, so when the screen shrinks, so does the element. There is no way to make it gradually change between percentages, you have to choose an absolute unit like pixels or ems and use percentages for the max-width property.
  12. 'Hello' and "Hello" are the same. The comma is part of the English sentence that is phrasing the question. Though it seems like a comma is probably not necessary in that part of the sentence. You could send an email to the site staff at help@w3schools.com to ask them to improve the phrasing of the question and avoid this kind of confusion.
  13. Tables stretch to fit the content within their cells. One way to solve it is to use the table-layout property in CSS. If there aren't too many table cells, you can wrap cell contents in divs and specify a maximum width for those divs to make sure that the cell text can wrap. If the table is just being used for visual layout purposes and don't contain tabular data, I would recommend replacing the table with other elements that are better suited for page design.
  14. I haven't checked but they most likely use AJAX to load a piece of content from the database and populate a box with it. There is Javascript and server-side code involved, it's not exactly simple.
  15. You can get the URL from location.href and use indexOf() to search for a string inside the URL. If you need a more complex search, you can use regular expressions.
  16. I'm not sure what you're looking for. There may be other ways to access the element, but you still need to pass a reference to the element to the dragElement() function. The line of code can be broken down into two parts: document.getElementById("mydiv"); gets a reference to the element. Read more about getElementById() here: https://www.w3schools.com/jsref/met_document_getelementbyid.asp dragElement( ... ) is the function defined right below. It takes an HTML element as a parameter. You can read about function parameters here: https://www.w3schools.com/js/js_functions.asp
  17. Ingolme

    C++

    That is because you have the cout statement inside the while loop. Take it out of the loop and put it further down in the code.
  18. Ingolme

    C++

    I'm not sure if you intended to use the assignment operator on this line: while (randNumb1 = randNumb2) { You probably want the == comparison operator. You shouldn't need to break that loop, either. The cout statement should be outside the loop after the loop has finished.
  19. white-space: nowrap is most likely the cause of the problem, so it would not work as a solution. white-space: normal is what would have to be applied to the element to override that.
  20. Closed due to duplicate, you can visit the thread here:
  21. There is no such function as sleep() in Javascript. Is that something provided by the Node.js environment?
  22. The link to the website has been removed because links to commercial websites are not permitted by the forum guidelines. Try to set up a simple code example with minimal HTML and CSS which reproduces the problem and people will be able to help you. The issue you're seeing it likely caused by a CSS rule preventing text from wrapping and hiding overflow.
  23. I am just a forum moderator. I have no involvement with the website. As far as I know, there is no way to download the tutorials.
  24. It is exactly the space left for hanging letters. This space appears beneath all inline and inline-block elements. Horizontal space to the left or right of inline elements is just the browser representing whitespace.
  25. There are many ways to do it. You just need a CSS selector which only matches elements in the navigation bar on a specific page. This could be done by giving a unique class name on the <body> element on each page, or giving a class to the navigation bar itself. Once you have the CSS selector, you can use it to apply different styled to the elements.
×
×
  • Create New...