Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. Here's a tutorial describing how to use events properly: https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#Event_objects
  2. The variable event is not defined. What is event for? If you don't know what it is for, that's an indication that you have been copying code without understanding it.
  3. Ingolme

    header info query

    If it returns false it probably means that it could not connect to the URL. file_get_contents() will get files from your local server. Depending on your server's configuration it might not be allowed to load files from remote servers. I recommend using cURL to load files from other websites: http://php.net/manual/en/book.curl.php
  4. Ingolme

    header info query

    Use var_dump() on the output of the get_headers() function and see what it shows. I doubt $_SERVER["yahoo.com"] would have anything in it, the $_SERVER array just contains some information about the server that the PHP code is running on.
  5. Yes, it is automatically hidden with CSS by using display: none. .modal { display: none;
  6. You have a variable called "event" which is not defined anywhere. What is it for? Unrelated to the issue, your code has four if statements doing the exact same thing, you should put them together with an OR operation like this: if(temp1 == 1 || temp2 == 1 || temp3 == 1 || temp4 == 1) { openCity(event, 'temperature'); } else { func(); } These variables "temp1", "temp2", "temp3" and "temp4" don't seem to be defined anywhere either. You need to define all of your variables and all of your functions.
  7. What string are you looking for? The element's tag name or the content within the element? What do you want to do with the string once you have it?
  8. You cannot have more than one <body> tag in the document and all of the page's content must be inside that <body> tag. You should use addEventListener if you need more than one function to run when the window loads.
  9. Please read the CSS reference, there is an entire page describing each of the selectors that you are asking about: https://www.w3schools.com/cssref/css_selectors.asp
  10. You should check the reference, it is described on this page: https://www.w3schools.com/cssref/sel_attr_begin.asp It's called a caret and it is used to select elements which have attributes that begin with the specified value. Here is the full CSS selector reference, each one of them is described in detail: https://www.w3schools.com/cssref/css_selectors.asp
  11. It's in the HTML tutorial. https://www.w3schools.com/html/html_links.asp You should finish the HTML tutorial before beginning to learn CSS.
  12. It's the .modal:target selector that is doing the work. :target selects any element which has an ID attribute that is being referenced by the hash part of the URL.
  13. You've put the open() and send() methods of the second request inside of the onreadystatechange handler.
  14. If you don't need it in the paragraph element, then remove the line of code that does that. Just delete this line, but keep all the rest of the code the same: document.getElementById("hw_maj").innerHTML = this.responseText; You need to understand what each line of code is doing. You should also delete that <p> element from your HTML since you're not using it.
  15. Are you asking about the selector or about the target attribute? The selector only will style an element which has a target attribute with value "_blank" The target attribute tells a link in which window or frame a link should open. "_blank" tells the browser to open a link in a new tab. "_top" will make a link that is inside of a frame open in the window that is containing the frame rather than staying inside the frame.
  16. That selector will select any element that has the target attribute, regardless of its value.
  17. Paragraphs do not have a value attribute, only form elements do. Use innerHTML instead.
  18. That will happen because you are scaling them. A scaled element will still reserve the same amount of space it was occupying before it was scaled. If you absolutely have to scale them, then you will have to wrap each one in a container that is the size of the iframe after scaling and set the container's overflow to hidden.
  19. The getAttribute() method should give you what you're looking for.
  20. It always depends on the context. The point is that not all of the elements need that rule, you have to determine which elements need to have that CSS rule to look correct.
  21. Multiplication and division have the same precedence, addition and subtraction have the same precedence. When two operators of the same precedence are found, the leftmost operation is done first.
  22. Give each button a name, then check on the server whether the name exists in the $_POST array and what value it has.
  23. Ingolme

    Include CSS

    You should not have any HTML tags in your CSS file. Not even <style> tags. The CSS file should only contain CSS rules.
  24. Since you're using a stylesheet that somebody else built, just leave it as it is. It's probably going to be too complicated to change it when somebody else used that as a foundation. If you can identify all of the elements that require box-sizing to work properly, then you can use a selector to target only those elements.
×
×
  • Create New...