Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 04/02/2019 in all areas

  1. 2 points
    You should call exit or die any time you're redirecting a user to prevent the code from executing any of the instructions that are further down. Nothing about the header() function tells the code to stop executing. header('Location: /Logon/Logon.php?From=Home'); exit;
  2. 2 points
    Use flex box <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Document Title</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="author" content=""> <!--<link rel="stylesheet" href="css/styles.css?v=1.0"> --> <style> *{box-sizing: border-box;} .layout-wrap { display: flex; min-height: calc(1px + 40vw);} .layout-col1{ display: flex; flex: 1 1 100%; max-width: 40%;} .layout-col2{display: flex; flex: 1 1 100%; max-width: 60%; flex-wrap: wrap; justify-content: space-evenly; } .layout-col2 >div, .layout-col1 >div { margin: 10px; border: 3px solid #000;} .div1 {flex: 1 1 auto;} .div2 { flex: 1 1 auto; max-width: 40%; margin-right: 5px;} .div3 { flex: 1 1 auto; max-width: 60%; margin-left: 5px;} .div4 { flex: 1 1 100%; max-width: calc(100% - 20px);} </style> </head> <body> <!--<script src="js/scripts.js"></script> --> <div class="layout-wrap"> <div class="layout-col1"> <div class="div1"></div> </div> <div class="layout-col2"> <div class="div2"></div> <div class="div3"></div> <div class="div4"></div> </div> </div> </body> </html>
  3. 1 point
  4. 1 point
    I see. You will need some special logic to run between Thursday and Saturday. It will use 60 hours but only after 12pm on Thursday. var THURSDAY = 4; var minDate = new Date(); var offset = 36; if(minDate.getDay() > THURSDAY || minDate.getDay() == THURSDAY && minDate.getHours() >= 12) { // Add 60 hours instead of 36 after noon on Thursday offset = 60; } minDate.setHours(minDate.getHours() + offset);
  5. 1 point
    Instead of grid, you could use flex box and set align-items to stretch. .wrapper { display: flex; align-items: stretch; } .sidebar { background-color: green; width: 10%; flex: 1 1 auto; } .archive-loop { background-color: red; width: 70%; flex: 1 1 auto; }
  6. 1 point
    It's a pseudo-element because a new element is created wrapped around the selected text. A pseudo-class is when a class is added to an existing element under certain circumstances.
  7. 1 point
    I think you have to work from the last child instead of first
  8. 1 point
    vLeftButton, IconL, leftAction(), hmmm wonder why it does not work for right? A real puzzler this one.
  9. 1 point
    Only the content inside the loop is repeated. This is what the string looks like on each iteration of the loop: text = "<ul>"; "<ul>" text += "<li>" + fruits[i] + "</li>"; "<ul><li>Banana</li>" text += "<li>" + fruits[i] + "</li>"; "<ul><li>Banana</li><li>Orange</li>" text += "<li>" + fruits[i] + "</li>"; "<ul><li>Banana</li><li>Orange</li><li>Apple</li>" text += "<li>" + fruits[i] + "</li>"; "<ul><li>Banana</li><li>Orange</li><li>Apple</li><li>Mango</li>" text += "</ul>"; "<ul><li>Banana</li><li>Orange</li><li>Apple</li><li>Mango</li></ul>" Since the string "<ul>" is not being appended inside the loop, it is not being repeated.
  10. 1 point
    Without the code I can't directly advise, however you should be able to use a click handler on those buttons, change the clicked button to blue (either apply class or direct style), and then display another one of those buttons where you'd like them to appear. The last one would be a lot more dependent on how it all works to begin with.
  11. 1 point
    This maybe unhelpful but it is one of the reasons why I make all my own icons. I don't want to have to rely on 3rd party code because it opens up vulnerabilities in your website.
  12. 1 point
    The error message you are getting indicates that the PHP version is most likely the issue. Make an empty PHP file and run the phpversion() function to verify that the version is what you need it to be.
  13. 1 point
    position: fixed takes the element out of the flow of other elements, other elements will occupy the space it would have occupied, so you need to add padding the same height as the w3--top element to force it back into view.
  14. 1 point
    Attribute autocomplete="off" https://www.w3schools.com/tags/att_input_autocomplete.asp https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_input_autocomplete
  15. 1 point
    It's a "feature" built into iPhone browsers. If you make sure that the font size of the text inside your inputs is at least 16px then iPhone won't try to zoom in to see it.
  16. 1 point
    Does using width: 100vw; make a difference? Then make input width proportional in vw also.
  17. 1 point
    <?php echo "What kind of issue are you having? Mind telling us more whats wrong with the code (expected results and what you are getting)"; ?>
  18. 1 point
    Localstorage will do that. First you set a default value if localstorage does not currently store any value related to chosen font size, else load localstorage value and make the chosen font-size active on page load or refresh. Then set onclick event to make selected fontsize active then at same set localstorage to store currently selected font-size also.
  19. 1 point
    HTML without CSS is practically useless in the modern web. If you don't know CSS in depth then you might as well not know HTML. CSS appears simple on the surface but it is actually more difficult to master than many people think. If you intend to be a full stack developer, it is usually a good idea to master the front end before moving on to the back end.
  20. 1 point
    filter_var() with the FILTER_VALIDATE_INT filter returns an integer, not true, so === true will always fail. By using The ! operator, they transform it into a boolean. This boolean, for any integer other than zero, is always false. This solution doesn't account for the integer zero which converts to true, but W3Schools also has a section talking about that. They could just use !!filter_var() or (bool)filter_var() and they wouldn't need the === false part. This would still not solve the integer zero problem, though.
  21. 1 point
    The shortest equivalent code you can make without conditionals would look like this: $str_browser_language = ''; if(!empty($_GET['language'])) { $str_browser_language = $_GET['language']; } else if(!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $str_browser_language = strtok(strip_tags($_SERVER['HTTP_ACCEPT_LANGUAGE']), ','); }
  22. 1 point
    Its always done that! Any floated element placed within a container element has no substance, so the container will collapse to height 0. Using property overflow reverses that condition for the container element.
  23. 1 point
    Ah , at last , it works: Ok Funce , I finally see what you meant . Thanks All . <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta charset="utf-8" /> <title>FreshDraft.StrippedDown></title> <style> @media print { .pageBreak{ page-break-after: always; } } </style> </head> <body id="bodyId" > <div> <br> <textarea class="copyFrom" spellcheck="false" rows="4" cols="12">textarea 1 line 1 textarea 1 line 2 </textarea> <br> <textarea class="copyFrom" spellcheck="false" rows="4" cols="12">textarea 2 line 1 textarea 2 line 2 </textarea> <br> <pre class="pageBreak">.</pre> <pre class="pageBreak">.</pre> </div> <br> <div> <br> <button id="printThisBtn" onclick="printAllThis()" style="display: block">Print This</button> </div> <script> var copyFrom = document.getElementsByClassName("copyFrom"); var pageBreak = document.getElementsByClassName("pageBreak"); var printThisBtn = document.querySelector("#printThisBtn"); function printAllThis() { collectedTextareas = ""; for (var i = 0; i < copyFrom.length; i++) { pageBreak[i].innerHTML = copyFrom[i].value ; } for (var i = 0; i < copyFrom.length; i++) { copyFrom[i].style.display = "none"; } printThisBtn.style.display = "none"; window.print(); console.log("window.printing"); for (var i = 0; i < copyFrom.length; i++) { copyFrom[i].style.display = "block"; } printThisBtn.style.display = "block"; } </script> </body></html>
  24. 1 point
  25. 1 point
    You've gotta modify this regex so you're using the entire string that matches as follows. (?=(.*\d){2})(?=.*[A-Z])(?=.*[a-z]).* Does this work for this one? And for this one, I've done a negative lookahead, that if it matches more than 3 digits, it won't be valid. ^(?=(.*\d){2})(?=.*[A-Z])(?=.*[a-z])(?!(.*\d){3,}).*$ Does this work for this one? Ab45 -> Match a4F8 -> Match aosjgHJ35 -> Match JsOsm4Osmf6 -> Match JsO2m4Os4f6 -> No match (3 numbers)
  26. 1 point
    It means that you can use "$0" as a variable in the console to reference the currently selected element.
  27. 1 point
  28. 1 point
    I guess I don't understand why you're not setting the value initially, I don't understand what the barrier to doing that is. How about just calling the reset function when the thing loads? That's what I'm talking about for the reset button doing the same thing as when it initially loads.
  29. 1 point
    Thank you Funce ! I will study this until I understand every 'jot and tittle' . You moved me to start a Folder for w3schools-Examples . http://vmars.us/w3schools-Examples/Draggable-Div-Elements-w3Schools-FUNCE.html Thanks again
  30. 1 point
    You can put that tag in the head to load that file, and the code in that file should use the DOMContentLoaded event to make sure the code runs after the page finishes loading.
  31. 1 point
    Add a return statement before the recursive call. You want to return the value of the recursive function.
  32. 1 point
    I just copied that code to a .html file on my computer and it seems to work correctly.
  33. 1 point
    dsonesuk Here's what I mean , see image :
  34. 1 point
    Hello everybody, I'm Paolo. Everytime I need something about all html world i fall into w3schools, so nice to join. Now developing under Filemaker which has a good support for html
  35. 1 point
    What is wrong? You expected center center not to work in media query? You'd be wrong, it would carry on from position styling from default non media query styling, as does background size, attachment and repeat. If you want to reset to default value use background-position: initial; in media query.
  36. 1 point
    In Javascript, all strings are internally treated as UTF-16 strings: http://ecma-international.org/ecma-262/5.1/#sec-8.4 http://speakingjs.com/es5/ch24.html
  37. 1 point
    Try to use the code block feature of the forum to format it nicely, colour it, and to avoid it getting eaten by the formatter. If you could edit your previous post. Adding an additional dropdown shouldn't be too bad. Just add another dropdown set after your previous <div class="dropdown"> and it'll also be in the navbar. <div class="dropdown"> <button class="dropbtn">New</button> <div class="dropdown-content"> <div class="row"> <div class="column"> <h3>Another 1</h3> <a href="#">Link 1</a> <a href="#">Link 2</a> <a href="#">Link 3</a> </div> <div class="column"> <h3>Another 2</h3> <a href="#">Link 1</a> <a href="#">Link 2</a> <a href="#">Link 3</a> </div> <div class="column"> <h3>Another 3</h3> <a href="#">Link 1</a> <a href="#">Link 2</a> <a href="#">Link 3</a> </div> </div> </div> </div> Unless you're after a sub-dropdown menu, as in a dropdown inside a dropdown. Then it gets trickier.
  38. 1 point
    Here's a version if you're not into the whole brevity thing: function getUnique(inputArr, comp) { const unique = inputArr.map(function (e) { // return an array of only one property from the original array of objects (if defined) console.log(e[comp]); return e[comp]; }).map(function (e, i, final) { console.log("final", final); console.log("e", e); console.log("i", i); // return an array of either false values or indexes // this will result in an array where each value is listed only once, in the first position it appears, // and any other appearances will be false // the array will be the same length return final.indexOf(e) === i && i; }).filter(function (e) { console.log("e", e); console.log(inputArr[e]); // this will create an array of objects from the original array in each index from the previously mapped temp array // this will exclude the duplicates because those indexes in the previous array are set to false return inputArr[e]; }).map(function (e) { console.log("e", e); console.log(inputArr[e]); // this will reindex the array to remove "holes" return inputArr[e]; }); console.log(unique); return unique; } var ar = [ { 'prop': 1 }, { 'prop': 2 }, { 'prop': 1 }, { 'prop': 3 }, { 'prop': 1 }, { 'prop': 4 }, { 'prop2': 1 }, { 'prop3': 1 } ]; getUnique(ar, 'prop'); What's the purpose? This function takes an array of objects, and will return an array of those objects that have unique values for a particular property. How do multiple values fit into that? Do you have an example?
  39. 1 point
    Post some code, and lets see where you've gone astray.
  40. 1 point
    You're not saving the return value of toFixed.
  41. 1 point
    The constructor always needs to be public. If you want properties to be private you need to declare them as private first. It's common to declare all of the properties before the methods. class AccountInformation { private $fname; private $connected = false; // you can initialize variables but only to scalar values, you can't initialize a property to another variable public function __construct($fname = '') { $this->fname = $fname; // you can only access a private property from inside this class $this->connect(); // you can only call a private method from inside this class } private function connect() { } } Have you always been in Finland? My wife lived there for 5 years.
  42. 1 point
    Perhaps you meant to write $('#wm_container').width(),
  43. 1 point
    If that is the full contents of the function, then yeah it doesn't actually do anything.
  44. 1 point
    It will return an array of the frequency of dates. The line that sets countDates[date] is equivalent to this: if (countDate[dates]) { countDate[dates] = countDate[dates] + 1; } else { countDate[dates] = 1; }
  45. 1 point
    Hi ShipMate, There isn't very many tools that can tell you what's wrong with an HTML document short of matching beginning and ending tags. Your source tag is self-terminating, you don't need </source> The only thing left to do is make sure there is CharleyFox.jpg inside your /images folder.
  46. 1 point
    So, in the end, the table was corrupted, and I had no back up. Alas, I reconstructed the entire table with UTF-8 encoding. The result was nothing but spectacular. I now have an in-tact Mecab parser that parses Japanese. Not only this, but the Mecab parser does not interfere with the parsing of French, English, and German., or likely any other language that using blank spaces to separate words. Arabic will be my next challenge, but I am fairly confident that it will work just like English with no additional encoding required. Roccy
  47. 1 point
    I figured this out. It involves nothing more than inserting an img into the button tag, adding the full sized image and other content to the div with the class of "modal-content." Very easy solution. Thank you!
  48. 1 point
    You only actually need to do it if you're specifically trying to refer to a global instead of a local variable, and both exist.
  49. 1 point
    Its possible its a computer issue. But I don't believe there's an issue in your code specifically. Maybe there's a bug with the plugin on Safari. Mac's aren't exactly the favoured operating system in the tech space.
  50. 1 point
    Hi everyone! I am Matthew and am new here.
×
×
  • Create New...