Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. I would say don't use float unless you actually need it. Float messes with the page flow.
  2. If you float the columns to the right rather than to the left then they will be ordered in reverse on desktop.
  3. Semi-colon is not a standard separator in SQL.
  4. As long as W3.CSS is included you can write the HTML anywhere.
  5. There's no specification indicating what controls the audio player should have, so each browser does its own thing. Perhaps browser vendors on iPhone decided that the screen wasn't large enough for a full audio player. Thanks to the Audio API, you can create your own controls with HTML and Javascript if you want your player to look the same on all devices. I believe that's what Youtube does.
  6. Ingolme

    html table

    The page I just linked to explains it. It selects elements at even and odd positions, respectively, in their parent element. You first need to understand what a CSS selector is.
  7. Ingolme

    html table

    That has nothing to do with HTML tables. It's a CSS selector. You can read about it here: http://www.w3schools.com/cssref/sel_nth-child.asp
  8. If you put the image inside a container with overflow: auto, scrollbars will appear. On most touch screen devices boxes with scroll bars let you tap and drag to move the content within it. HTML <div class="pan"> <img src="file.jpg" alt="My photograph"> </div> CSS .pan { width: 900px; height: 500px; overflow: auto; }
  9. It's already doing that. You don't need the onreadystatechange event handler if you don't need information from the server. This will work: function RecordTime(y) { var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET", "process.php?p2=" + y, true); xmlhttp.send(); } Normally, though, you will want to make sure that the server got the information, so you would have your PHP end print out a message to indicate that it got the value you're sending. <?php if(!empty($_GET['p2'])) { echo 1; } else { echo 0; } ?> Then in your Javascript end you would check to see if the server returned "1" function RecordTime(y) { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { // Request is complete when readyState is 4 if(xmlhttp.readyState == 4) { // Make sure no server errors occurred if(xmlhttp.status != 200) { alert("Request failed"); } // Response is inside the responseText property if(xmlhttp.responseText != "1") { alert("Processing failed"); } } }; xmlhttp.open("GET", "process.php?p2=" + y, true); xmlhttp.send(); }
  10. If you're planning to learn Node.js, PHP is not required. Choose a server-side language of your liking, PHP just happens to be popular because it's easier to learn. I would advise against learning Bootstrap before learning how to make responsive sites in pure CSS. If you don't know how it works you'll have a lot of trouble debugging issues with it.
  11. open() and send() have to be called outside the readystatechange event handler. function RecordTime(y) { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { // This event fires five times during a successful request } xmlhttp.open("GET", "process.php?p2=" + y, true); xmlhttp.send(); }; Keep in mind that the onchange event only fires when the text field loses focus.
  12. Here's a list of forum software written in PHP: https://en.wikipedia.org/wiki/Comparison_of_Internet_forum_software Most of them can be customized with templating systems. You don't necessarily have to go with PHP either, you could choose from any number of other server-side programming languages.
  13. You should check to see what properties are available in the event object. You should be assigning event handlers in Javascript and not in the HTML. (If you don't know how to do that then look up addEventListener)
  14. One would choose to not use bootstrap if they want the same layout on 50 different pages and have the flexibility of altering the layout when necessary.
  15. You can't get files from the internet if you're not connected to the internet. You could download day.txt and host it on your own server. If you want to prevent an error message you can use the error suppression operator "@" and use the return value of the function to determine that it failed. $data = @file_get_contents($url); if($data === false) { echo 'Unable to open file.'; }
  16. Ingolme

    Using Templates

    There is no CSS for that template aside from the main W3.CSS library. The entire layout is done using HTML and class attributes.
  17. I'm not sure what you mean by working offline. You say it failed, what shows up in the browser when it fails? Is there any error message?
  18. It looks like Google does not permit putting their calendar into frames. They're sending an "X-Frame-Options" header that disallows it.
  19. While there are question makes on "Basic suppport" I'm certain that the events are supported on all browsers that support the <audio> element.
  20. Here's a list of events that happen on the audio and video elements: https://developer.mozilla.org/en/docs/Web/Guide/Events/Media_events There's a playing event that should fire once the user has clicked the play button. There's also a pause event.
  21. Set the first div to float to the left. Give the second div a left margin equal to or greater than the width of the first div. The second div should not have any width value given in the CSS.
  22. By making the variable global. To make a variable global, just declare it outside of any function and don't use the var keyword inside the functions. var weare; $(document).ready(function () { weare = [ "Young and free" ]; }); (function (jQuery) { weare = [ "inspired by music" ]; })(jQuery)
  23. You cannot without also modifying the first code. The variables are declared in different scopes.
  24. Usually I use null if the variable is meant to contain an object but I don't have the object yet.
×
×
  • Create New...