Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. You still need cURL to use the API, but the API would save you the trouble of trying to pull out data from the HTML code.
  2. No, putting .json wouldn't do anything. If they had an API they would say so in the documentation of their website. Have you learned to use cURL yet?
  3. Ingolme

    ContactUs Form

    Please leave the moderating to the moderators. I'll close this thread. You may continue discussion about your contact form here: http://w3schools.invisionzone.com/index.php?showtopic=52984
  4. Have you checked to see if the website provides an API to get the information?
  5. setTimeout() and setInterval() return a positive integer to be used as an identifier for the timer. There's no specification as to what value the number should have aside from being a positive integer. Some browsers may choose to start with 1, while others might decide to use a random number.
  6. I just use the PHP manual when I need to know how to use a library or function: http://php.net/curl
  7. That's called margin-bottom. Padding is space inside the box, margin is space outside the box.
  8. You could start by searching for PHP cURL tutorials. cURL is used to make requests to remote servers.
  9. You should read this article: http://www.sitepoint.com/html5-main-element/
  10. Your idea of setting the <base> tag to the exact same URL as the current page is redundant, it's the same as not using the <base> element at all. People use the <base> element when they want relative links to point to somewhere different. Usually, they have it pointing to a different directory.
  11. If the <aside> element has content that's unique to the page (in every page on your site something different is there) then you should put it inside the <main> tag. The <main> element should encompass everything that is unique to the page.
  12. Ingolme

    Virus

    If your antivirus doesn't like it then it's safe to let your anti-virus delete it.
  13. It's a common practice to have a set of language files and include the one that's needed. A database is probably not as good an idea. The good thing with language files is that you can send it to a translator and have them change the strings without needing to create a database interface for them. I suggest using printf() or sprintf() for them, so that you can have variables in the string: English: $lang['choose'] = 'Choose %d items.'; Spanish: $lang['choose'] = 'Elige %d objetos.'; On your page: printf($lang['choose'], 3);
  14. The timers used in setInterval and setTimeout are very imprecise. I actually wouldn't suggest using times under 16 milliseconds, because browsers in generally don't usually refresh the screen more then 60 times a seconds.
  15. The <main> tag is for content that is unique to the page. Headers, navigation and footers go outside the <main> tag, everything else goes inside it. Here's a basic HTML 5 document structure: <header><h1>Site name</h1></header><nav> <ul> <li><a href="#">Nav link</a></li> <li><a href="#">Nav link</a></li> <li><a href="#">Nav link</a></li> </ul></nav><main> <h2>Page title</h2> <section> <h3>Section 1</h3> <p>Content of section 1</p> </section> <section> <h3>Section 2</h3> <p>Content of section 2</p> </section></main><footer> <nav><!-- Perhaps a few footer navigation links --></nav> <p>Some more footer content</p></footer> Navigation tags can go inside or outside the <header> and <footer> elements, it doesn't matter.
  16. Just open your HTML files in a real browser. If you want to check whether the code is valid or not, use http://validator.w3.org/
  17. I don't see any errors there. Where did you see the error?
  18. Ingolme

    NTX file

    "Application" means a program. Applications are associated with file types. Adobe Reader is associated with PDF files, Microsoft Word is associated with .doc files, Windows Media Player is associated with WMA files. You need to figure out where your file came from. I assume it didn't just appear on your computer out of nowhere. Who gave you the file?
  19. This isn't valid XML: </card Id> It should be just </card> I don't think it's a requirement in XML, but it would be better if you don't have spaces between your attribute names and values. You should read the XML tutorial: http://www.w3schools.com/xml/default.asp You need to understand the proper syntax for an XML document as well as what elements, tags and attributes are.
  20. This isn't valid XML <cardId ="01"> Perhaps you meant <card id="01"> or <cardId>01</cardId>
  21. Ingolme

    pls help

    One problem is that you selected document.getElementById("btnsubmit"); but your element's ID is btnSubmit. You shouldn't be calling init() when the button is clicked, either. That should only be called when the window loads. So remove onclick= "init();" from the button.
  22. It's very overkill to create an object color() with a single property color just to hold a string and assign it to a variable with the very same name as the value of the string. That's like three levels of unnecessary abstraction. If you need a list of colors, make a single array of strings: var colors = ["red", "green", "blue"]; As a general rule, if your object doesn't have methods (functions) in it, there's no need to make a constructor for it.
  23. Check your browser's console for Javascript errors. In most browsers you can see the console by pressing F12.
  24. The problem is that you're getting the stirng value of an object rather than a string containing the name of the color. The function declaration should also have parentheses after the function name. Try this instead: //*Array of colorsvar colors = ["red", "blue", "green", "purple", "yellow", "black"]; //*Function that chooses a random shirt colorfunction changeShirtColorRandom() { var num = Math.floor(Math.random() * colors.length); var color = colors[num]; document.getElementById("torsoColorChange").style.backgroundColor = color; document.getElementById("right-sleeveColorChange").style.backgroundColor = color; document.getElementById("left-sleeveColorChange").style.backgroundColor = color;} If you want each element to have its own random color, then create one random number for each: function changeShirtColorRandom() { var num, color; num = Math.floor(Math.random() * colors.length); color = colors[num]; document.getElementById("torsoColorChange").style.backgroundColor = color; num = Math.floor(Math.random() * colors.length); color = colors[num]; document.getElementById("right-sleeveColorChange").style.backgroundColor = color; num = Math.floor(Math.random() * colors.length); color = colors[num]; document.getElementById("left-sleeveColorChange").style.backgroundColor = color;}
  25. Ingolme

    Flattr

    W3Schools makes a whole lot of money from advertising. Just a text link costs at least $1200 a month and banner ads are probably over $2000 a month (They used to have the prices on this page but they removed it) I think they probably don't need donations.
×
×
  • Create New...