Jump to content

callumacrae

Members
  • Posts

    89
  • Joined

  • Last visited

Everything posted by callumacrae

  1. There's nothing automatic because it's a stupid thing to do. There are plenty of free flowchart solutions, though.
  2. If you've written your login code correct, you should have a sessions table; just add a column to show when the user was last active. If you haven't got a sessions table, you are not of a level of PHP where you should be writing a login system. They're one of the trickiest things to write, and if you mess them up and get hacked, you will annoy a lot of people.
  3. Yeah, you can modify document.title to change the title of the page: document.title = prompt('Modify the title', document.title); However, you shouldn't use the prompt function. It's ugly and invasive, and your users will hate you. You should use an input box on your page instead.
  4. Regular expressions have the following syntax: /expression/flags The two forwards slashes (/) are what makes it a regular expression, just like strings have quotes around them. The expression is the regular expression itself, and the flags are stuff like telling the regular expression to be global ("g" is the modifier, not "/g"). I would recommend disregarding the w3schools regex ref you linked to, it isn't very good.
  5. Ask them to enable it for you. Ask them why not. Change hosting provider.
  6. callumacrae

    javascript

    It's not a long string of alerts, it's even worse; it is fix one field, get new error message when submitting for, fix the next field, etc.
  7. No, that wouldn't do it. JSON.stringify has its own error message for cyclic structures, and it is also a TypeError.
  8. Again, that's a silly and unrealistic example. A practical example which is similar to that would be to insert an image before every external link warning the user that they would be leaving the site: img:not([href^="http://example.com"],[href^="/"]):before { content: url('./imgs/external.png');} Note: You should not use gifs, either.
  9. It is our responsibility as experienced developers to ensure that less experienced developers do not develop habit habits or make the same mistakes we did. The amount of time I have spent searching for incorrectly spelled variables... I did not "flog" him, merely pointed it out.
  10. What?Do you know why we have conventions on variable naming? I'll give you a clue: it isn't to make the code pretty.
  11. callumacrae

    javascript

    OP originally posted a huge block of code with no whitespace, but has now edited it down to two seemingly irrelevant lines.
  12. callumacrae

    Test

    You don't need a test. Just make a website and run it through the validator.
  13. callumacrae

    javascript

    What specifically is going wrong here? Could you provide a minimal case so that I don't have to work through all your code to find out what the problem is myself.
  14. callumacrae

    javascript

    Yes.I don't like writing short replies, but there is seriously nothing more I can say here.
  15. callumacrae

    Test

    What do you mean? Do you mean something like unit tests?
  16. You shouldn't use the onclick attribute to add events, you should use the addEventListener function (and possibly .attachEvent if you want support for oldIE).
  17. Don't use tables for layout. Don't use tables for layout. Don't use tables for layout. I can't look at your code right now, but if nobody has given a full answer by the time I get back, I will.
  18. I'm Callum Macrae. I've written a book on JavaScript and have been working as a front-end developer for a good few years now. I want to see if I can improve w3schools.
  19. It tells the search engine that a link is for navigating about the site, and so helps more of your site be relevantly indexed.
  20. A linear gradient is a gradient which starts of at one colour, and then fades to another colour at a linear speed across the element:
  21. I can't remember where I learned this stuff from, but I imagine that if you buy a good CSS book, it will cover it. I would recommend CSS3: The Missing Manual or CSS: The Definitive Guide. Pretty much any O'Reilly book would do the trick, though.
  22. The validator doesn't always output the code exactly as it was (or it sometimes messes up the whitespace).
  23. That's not a problem at all, most developers do it on a fairly regular basis. If you specifically aim to not use IDs and classes on the same elements, you will end up with either some very messy CSS, or some really messy HTML.
×
×
  • Create New...