Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. If the desktop is larger than 1024 pixels then the styles for tablet should not affect it.
  2. You can use a media query of max-width 1024 to target the tablet and devices smaller than that.
  3. Put it in a block of code that actually gets executed. I don't know how you have so much trouble understanding a simple if() statement. Please read the Javascript tutorial on W3Schools.com
  4. I tested to make sure, the function works without brackets, but I still would recommend adding them.
  5. The idea behind responsive design is to be device-independent. If two devices have the same screen size then you should be rendering the page the same for both of them. Why would you want to show it differently?
  6. The first thing you need to understand is that Google has billions of dollars and thousands of experienced programmers. When you're trying to emulate any of their projects you have to ask yourself if you have the time and resources to imitate something of such a large scale. Fortunately, creating a basic login system for a single website is not too difficult, but the more features you want to add the more difficult it becomes. Before you start any programming at all you need to determine what your requirements are: Do you want protection against brute force attacks? Do you want an account recovery system and if so, how do you want it to work? Does to user have their own profile page? How much information about the user do you want to store? Do you want to keep a log of user activity? Is there protection against spam bots? A CMS is likely to do everything you want from a registration system. There are so many of them out there, like Joomla, Wordpress, PyroCMS or ExpressionEngine and hundreds more. You don't just have to rely on what the CMS has, a lot of content management systems offer APIs which you can use in PHP to customize the way it works. If you don't want to use a CMS the database structure and code for a login system depend very heavily on what your requirements are.
  7. The script worked when I tested it. What happens when you try it and what did you expect?
  8. Unity is a game engine which allows coding to be done in one of several languages including Javascript, but this is way outside the realm of web development.
  9. You don't compile Javascript for the web. Some programs that use Javascript for programming, such as the Unity game engine, will compile the code, but that's not how Javascript is generally used.
  10. Putting an empty array in the query string is not wrong. The empty square brackets is a shorthand expression meaning "add an element to the end of the array"
  11. No, that else is inside an if() statement that never is executed. Here's your code: if(x == y) { ... All console.log() calls here, even the else statement is inside here } If x is not equal to y then console.log() is never called. When I say it doesn't return anything I mean that the code does not evaluate to a value. In the console you can write Javascript expressions, such as x == y and the console will show the value to expression evaluates to (it would display "true" for the previous expression). If there is not an expression in your code it will just show undefined, which is not a problem. The problem in your code is that console.log() is never being called and I've already explained why.
  12. Ingolme

    W3 buttons

    That might be because of the way browsers treat form elements. Even displaying them as block won't make them take the full width of their container. If you changed <button> for <div>. <a> or any other non-form element it would work. If you specifically require a button you can set its width to 100% with CSS.
  13. You'll need to learn programming and acquire problem solving skills, because once you have those two things you will be able to do anything you want to. There isn't a tutorial for that specific kind of navigation because the person who made it did not base it on any pre-existing program. Any good programmer is capable of solving a problem without the step by step process of a tutorial because in general programmers build things that haven't already been done or if they have been done the original creators do not want to expose how they did it. Things that might come in handy to build a system like the one you want 1. Javascript: http://www.w3schools.com/js/ 2. DOM: http://www.w3schools.com/js/js_htmldom.asp 3. Manipulating the style of elements on the page: http://www.w3schools.com/jsref/dom_obj_style.asp 4. Events: http://www.w3schools.com/js/js_htmldom_events.asp
  14. If you're running this script straight in the console then it shows undefined first because that code does not return anything. From the look of that code, it should never write anything to the console because x is not equal to y. Here's the code properly indented so that you can see that the code will do nothing unless x and y are the same. var x = "b"; var y = "a"; var z = "c"; if(x==y) { if(x==z) { console.log( "equal"); } else { console.log("not equal"); } }
  15. That program is useless because it can be replaced with this: 30 Programs like that are just made for educational purposes to explain variable assignment and operators. The program could be made useful if you did not hardcode the values, for example: <?php $x = $_GET['x']; $y = $_GET['y']; echo $x + $y; ?> Now you can send data to it with a form or by changing the query string, allowing the user to change the result.
  16. That's the way PHP reads the query string. If you wrote page=main[] then it would assume that $_GET['page'] had the string "main[]". When PHP reads [] next to a query string key it interprets the key as an array, that's just the convention. You can also pass indices in the query string and PHP will pick it up, such as ?page[test]=main which PHP would interpret a $_GET['page']['test'] = "main"
  17. Hardcoded refers to data that is embedded directly within the code rather than coming from an external source. Usually hardcoded information is bad because updating the value means modifying code which is generally more risky and time consuming than having all the necessary data in a place specifically intended to store data. This is a hardcoded string: $str = "Hardcoded string"; Here's a string that's not hardcoded: $str = get_string_from_the_file(); In both cases $str ends up containing the same string, but in the first case the string was embedded directly in the code.
  18. That's not done with Javascript, that's done with a server-side language.
  19. It's a canvas on which Javascript is used to draw dots and lines. Read a brief introduction about canvas here: http://www.w3schools.com/html/html5_canvas.asp If you wish to learn more I would suggest looking at the Mozilla Developer Network (You can search for that)
  20. What selector did you add it to? The clear: both should be only on #navigator and not any other elements.
  21. Because the text is floated to the left, there's space available for the box below it to occupy. You can fix that by adding clear: both; to #navigator.
  22. I think this is due to iPad using the operating system's default button style. You can force the button to not do that using -webkit-appearance: none on its CSS.
  23. Perhaps an old version of PHP actually used a variable called $PHP_SELF
  24. It looks like your XSL works. Are you asking how to do this with PHP?
  25. The page fails to load any CSS or Javascript files. http://chiquado.site90.net/latest.html
×
×
  • Create New...