Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 01/29/2019 in all areas

  1. 2 points
    I generally prefer to support the least common denominator to give the users of my website the best experience regardless of which browser they're using.
  2. 1 point
  3. 1 point
    You can use an internet address as the src attribute of the iframe and it will work without any problem. If you write HTML between the iframe tags, that won't work. The browser ignores it. I'm referring to code like this: <iframe> <table> <tr> <td>...</td> <td>...</td> <td>...</td> </tr> </table> </iframe> That table gets ignored, the only thing that gets shown in the iframe is whatever is in its src attribute.
  4. 1 point
    Thank you, Funci, for your very hard effort. Together we nailed the source of the problem. And, thank you, Ingolme, for providing the solution. Once again, I wish Ingolme, Funci, Dsonesuk, and everyone else at W3Schools a very Happy New Year! Roddy
  5. 1 point
    I can stick around for a while Roddy. Just grabbed lunch(Oh New Zealand time) so I'm quite clear for the next few hours.
  6. 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.
  7. 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.
  8. 1 point
    $display= overwrites the prev output, you need to append to prev output with $display.=
  9. 1 point
    It's optional, I don't see a reason to use it.
  10. 1 point
    .team-members { width: 25%; display: inline-block; padding: 3.8em; vertical-align: top; /* add this */ }
  11. 1 point
    Just so you know, the LIMIT keyword indicates the number of rows to output. In this case, it is including Row 0 (first row) up to (but not including) Row 25 (26th row). Its quite common for it to be added to SQL browsers such as phpmyadmin and others. Just so if you have 70k rows (like I work with) you don't kill your program trying to look at all of them.
  12. 1 point
    You need to understand how the conditional works. In the statement X = C ? A : B , X is either equal to A or equal to B based on whether C is true or not. In other words: if(C) X=A else X=B
  13. 1 point
    No, that is incorrect. Each line is its own set of conditions completely independent from the other line of code. It is equivalent to the following code: if(!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $str_browser_language = strtok(strip_tags($_SERVER['HTTP_ACCEPT_LANGUAGE']), ','); } else { $str_browser_language = ''; } if(!empty($_GET['language'])) { $str_browser_language = $_GET['language']; } else { $str_browser_language = $str_browser_language; }
  14. 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.
  15. 1 point
  16. 1 point
    I wouldn't count on the filesystem returning data the way you want, I would get the list of all of the files and folders, sort them however you want to sort them, and print the sorted list.
  17. 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)
  18. 1 point
    It means that you can use "$0" as a variable in the console to reference the currently selected element.
  19. 1 point
    I'm not sure how to do it with one pattern, I don't use lookahead or lookbehind very often. I would use multiple patterns, but there's probably a way to do it with one.
  20. 1 point
    Hello & Thanks; Here is a ' mini-Tutorial: moving text to & from <textarea> & <pre> ' http://vmars.us/ShowMe/Tutorial-Textarea-Save-CopyTo-RestoreFrom-onLoad-Restore-RO-VM.html I'll also put code here for safekeeping : <!DOCTYPE html> <html> <head> <!-- https://www.freeformatter.com/html-validator.html http://vmars.us/ShowMe/Tutorial-Textarea-Save-CopyTo-RestoreFrom-onLoad-Restore-RO-VM.html --> <title id="titleId"></title> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta charset="UTF-8"> <style> </style> </head> <body onload="documentURL() , onloadRestoreTextarea()" > <br> <button onclick="saveAs(filename, allHtml)">Save This Page</button> <br><br> <div id="inlineDiv" style="display: inline-block;"> <div style="border-style: solid; align-text: center; border-width: 1px; display: inline-block;"> <button onclick="sendToConcoleLog ()">sendToConcoleLog</button> <br><br> <textarea id="toConsoleLogId" rows="4" cols="12">:</textarea> </div> <div style="border-style: solid; align-text: center; border-width: 1px; display: inline-block;"> <button onclick="saveItAll()">Copy this into PRE</button> <br> <textarea class="copyFrom" rows="4" cols="12"></textarea> </div> <div style="border-style: solid; align-text: center; border-width: 1px; display: inline-block;"> <button onclick="restoreItAll()">Restore this from Pre</button> <br> <pre contenteditable="true" class="pasteInto" ></pre> </div> </div> <!-- id="inlineBlock"> --> <div style="border-style: dotted; align-text: center; border-width: 1px;"> <pre> Thought I would make a turorial so I remember what I learned from you all , and to pass on your wisdom. Hope this helps someone :) Try this: ------------------------------------------------------------------------------------------------------------------------ 1) Type something into "Copy this into Pre" textarea box . Then click "Copy this into Pre" Button . Text is copied into "Restore this from Pre" "pre area ' . And "Copy this into Pre" textarea box , is Cleared . Study This : function saveItAll() ------------------------------------------------------------------------------------------------------------------------ 2) The click on "Restore this from Pre" Button , Text is copied from "Restore this from Pre" area into "Copy this into Pre" area . And "Restore this from Pre" area , is Cleared . Study This: function restoreItAll() ------------------------------------------------------------------------------------------------------------------------ 3) Now Type something into "Copy this into Pre" textarea box Again . Then click "Copy this into Pre" Button . Text is copied into "Restore this from Pre" pre area . And "Copy this into Pre" textarea box , is Cleared . But this time , click the "Save This Page" Button . Study This: function saveAs(filename, allHtml) This .html page will be saved in your Browser's download area . Since the "Restore this from Pre" pre area , is coded as contenteditable="true" , the downloaded page will save the "pre area" text as innerHTML . A nifty feature of 'contenteditable' is that upon opening the saved-page the content of "pre area" is now " hardCoded " into page . Study This: function onloadRestoreTextarea() ------------------------------------------------------------------------------------------------------------------------ See code : So in the ' body ' tag we have : "onloadRestoreTextarea()" which runs the " function onloadRestoreTextarea() " code , when page is loaded . Which copies text from "pre area" to " textarea" box . Also at ' body onload="documentURL() ' page load time: The function: function documentURL() is run , which copies ' this .html ' file's address into the ' title ' tag . BTW: for example (see code) and note that : IF you want to copy what’s typed in the box use .value . console.log(toConsoleLogId.value); IF you want what was hardcoded into the text box’s HTML , use .innerHTML . console.log(toConsoleLogId.innerHTML); Hope this helps someone.... http://vmars.us/ShowMe/Tutorial-Textarea-Save-CopyTo-RestoreFrom-onLoad-Restore-RO-VM.html </pre> </div> <script> var copyFromVar = "one"; function saveItAll() { var blankVar = ""; var fromList; // = document.getElementsByClassName("copyFrom"); var intoList; // = document.getElementsByClassName("pasteInto"); fromList = document.getElementsByClassName("copyFrom"); intoList = document.getElementsByClassName("pasteInto"); for (var i = 0; i < fromList.length; i++) { copyFromVar = fromList[i].value ; intoList[i].innerHTML = copyFromVar; fromList[i].innerHTML = blankVar; fromList[i].value = blankVar; } }// </script> <script> var copyFromVarTwo = "two"; function restoreItAll() { var blankVar = ""; var fromListTwo; // = document.getElementsByClassName("copyFrom"); var intoListTwo; // = document.getElementsByClassName("pasteInto"); intoListTwo = document.getElementsByClassName("copyFrom"); fromListTwo = document.getElementsByClassName("pasteInto"); for (var i = 0; i < fromListTwo.length; i++) { copyFromVarTwo = fromListTwo[i].innerHTML ; intoListTwo[i].value = copyFromVarTwo; copyFromVarTwo = fromListTwo[i].innerHTML ; intoListTwo[i].value = copyFromVarTwo; fromListTwo[i].innerHTML = blankVar; fromListTwo[i].value = blankVar; } } </script> <script> var copyFromVarOnload = "three"; function onloadRestoreTextarea() { var fromListTwo; // = document.getElementsByClassName("copyFrom"); var intoListTwo; // = document.getElementsByClassName("pasteInto"); var blankVar = ""; intoListTwo = document.getElementsByClassName("copyFrom"); fromListTwo = document.getElementsByClassName("pasteInto"); for (var i = 0; i < fromListTwo.length; i++) { copyFromVarTwo = fromListTwo[i].innerHTML ; intoListTwo[i].value = copyFromVarTwo; copyFromVarTwo = fromListTwo[i].innerHTML ; intoListTwo[i].value = copyFromVarTwo; fromListTwo[i].innerHTML = blankVar; fromListTwo[i].value = blankVar; } } // reloadTextarea </script> <script> function sendToConcoleLog() { var var01 = toConsoleLogId.value; console.log(var01); // alert(var01); var var01 = toConsoleLogId.innerHTML; console.log("If nothing after : Then no nothing was typed into this textarea => " + var01); alert("If nothing after : Then no nothing was typed into this textarea => " + var01); console.log(toConsoleLogId.value); console.log(toConsoleLogId.innerHTML); /* should be console.log(toConsoleLogId.value); if you want what’s typed in the box, or console.log(toConsoleLogId.innerHTML); if you want what was hardcoded into the text box’s HTML. */ } </script> <script> var filename = ""; function documentURL() { document_URL = document.URL; document.getElementById("titleId").innerHTML = document_URL; } </script> <script> var filename = "Textarea-Save-CopyTo-RestoreFrom-onLoad-Restore.html"; var allHtml = document.documentElement.outerHTML; function saveAs(filename, allHtml) { allHtml = document.documentElement.outerHTML; var blob = new Blob([allHtml], {type: 'text/csv'}); if(window.navigator.msSaveOrOpenBlob) { window.navigator.msSaveBlob(blob, filename); } else{ var elem = window.document.createElement('a'); elem.href = window.URL.createObjectURL(blob); elem.download = filename; document.body.appendChild(elem); elem.click(); document.body.removeChild(elem); } } </script> </body> </html>
  21. 1 point
  22. 1 point
    You'll draw using a canvas: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial There's a discussion about animation in general here: https://javascript.info/js-animation
  23. 1 point
    Your for needs a method="POST" attribute.
  24. 1 point
    Add the u modifier to your pattern: /[^A-Za-z0-9!\"#%£&()=@\s]/u
  25. 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.
  26. 1 point
    I just copied that code to a .html file on my computer and it seems to work correctly.
  27. 1 point
    If you use include_once or require_once to include files in PHP then it will only include the same file once even if there are multiple include statements. Hopefully you have a main PHP include file that your other PHP files include that defines various global functions and variables, and that would be the place to include any file that you want available on any other page.
  28. 1 point
    justsomeguy is right, if you have complex data, better to store it in a database, server-side or client-side. Even HTML5 (using JS) has a way to store data called webstorage. Choose the way that suits you best
  29. 1 point
    OK. I get it.! The properties value and enumerable are property descriptors. They define the nature of the property getFoo. Thanks! Roddy
  30. 1 point
    The second argument of the Object.create() method contains property definitions which follow a specific format. In your code, the definition of getFoo is saying that its value is a function and that it is enumerable. You can see all of the different features that a definition can have here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperties#Parameters If you want your code to behave as you predicted, just drop the Object.create() method and assign the object directly: var jsonLinkObj = { getFoo: { value: function() { return this.foo = 1; }, enumerable: false } }; The purpose of Object.create() is mainly for copying existing objects, if you are just creating a new one you probably don't need it.
  31. 1 point
    Hello everyone, You may call me Lysh. In my twenties. I've messed with coding here and there when I was a part of other forums and on tumblr. (That's just the mere basics of html.) I had been interested of learning more off and on, but I can say now, definitely, I am eager to learn completely.
  32. 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.
  33. 1 point
    I'd remove all text direction modifiers. They are the Unicode characters 202A, 202B, 202C, 202D, 202E, 202F.
  34. 1 point
    Do you know how to use lists? If so I think you might get a lot of mileage out of the string method .split https://www.w3schools.com/python/ref_string_split.asp
  35. 1 point
    This seemed to me to be an easier solution to your problem. Check the reference links for further information or look up the new Set() function of ES6 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width-device-width,initial-scale=1.0, user-scalable=yes"/> <title> Unique Object Entries </title> <!-- From: http://w3schools.invisionzone.com/topic/59291-eliminating-objects-of-an-array/ --> </head> <body> <script> var visitData = [ {'visitorID':'6b77f74d969f0254','fullDate':'2019/01/01'}, {'visitorID':'6b77f74d969f0254','fullDate':'2019/01/01'}, {'visitorID':'8305d1d7c98cfe07','fullDate':'2019/01/03'}, {'visitorID':'8305d1d7c98cfe07','fullDate':'2019/01/03'}, {'visitorID':'8305d1d7c98cfe07','fullDate':'2019/01/03'}, {'visitorID':'8305d1d7c98cfe07','fullDate':'2019/01/03'}, {'visitorID':'8305d1d7c98cfe07','fullDate':'2019/01/04'}, {'visitorID':'470b11ecb96f51a8','fullDate':'2019/01/04'}, {'visitorID':'470b11ecb96f51a8','fullDate':'2019/01/05'}, {'visitorID':'7783172ce39cd663','fullDate':'2019/01/05'}, {'visitorID':'1834494d8537012d','fullDate':'2019/01/06'}, {'visitorID':'3321037b66164959','fullDate':'2019/01/06'} ]; /* Following solution from: https://stackoverflow.com/questions/36032179/remove-duplicates-in-an-object-array-javascript */ var uniq = new Set(visitData.map(e => JSON.stringify(e))); var res = Array.from(uniq).map(e => JSON.parse(e)); console.log(JSON.stringify(res)); </script> </body> </html>
  36. 1 point
    It's just the initial value. If you don't start off with an initial value then you make a new object every time and return it.
  37. 1 point
    That's just a alternative way of defining a function in EcmaScript 6. It's saying the function accepts 2 parameters, countDates and date, and then has the statements where it builds and then returns the array. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions The empty object is the initial value to use for the accumulator for reduce. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce
  38. 1 point
    For a html4 strict document its not all that strict! Validate at https://validator.w3.org/nu/#textarea To see why. Use the same video ONLY in a html5 document, at the same file location as html4 document and compare the result. It will save time trying to get to work in html4 document when it being html4 IS the problem.
  39. 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!
  40. 1 point
    https://www.w3schools.com/code/tryit.asp?filename=G3H9N1MTA9MT https://www.w3schools.com/code/tryit.asp?filename=G3H9TSDK80Q1
  41. 1 point
    The original posted code works as it should on both mouse and hover style screens. Personally I would leave it as is. However, if I am reading your original request correctly, you want the content selections to be visible when the title is clicked on and removed when it is clicked a second time. Forgive me if that is not the desired results. To accomplish this, you could make these changes to your code. In the CSS section, change: <style> .wcustomhtml { overflow: visible !important; } .dropbtn { background-color: #a1a1a1; color: white; min-width: 250px; padding: 16px; font-size: 16px; border: none; } .dropdown { position: relative; display: inline-block; } .dropdown-content { position: absolute; background-color: #f1f1f1; min-width: 250px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: 1; } .dropdown-content a { color: black; padding: 12px 16px; text-decoration: none; display: block; } .dropdown-content a:hover {background-color: #ddd;} .hide { display: none; } </style> Add a JS section with this: <script> function init() { const sel = document.querySelectorAll('.dropbtn'); for ( let el of sel) { el.addEventListener('click', function () { el.nextElementSibling.classList.toggle('hide'); } ); } } init(); </script> Un-tested on phone: Might also be able to combine CSS with separate 'media' setups Another un-tested attempt would be able to use the CSS above but add in the original :hover logic for the button as well but it might be confusing to the user when the display occurs both on hover and click (with possible conflicts due to simultanous displays) Add the following CSS back into the block to see resulting actions .dropdown:hover .dropdown-content {display: block;} .dropdown:hover .dropbtn {background-color: a1a1c1;} I don't like this, but if it fulfills your needs then feel free to experiment further. Final version incorporating code for each of the suggestions above. Current setup below is for clicking the top buttons to hide/show rather than hover actions. <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width-device-width,initial-scale=1.0, user-scalable=yes"/> <!-- From: http://w3schools.invisionzone.com/topic/58819-weebly-dropdown-need-help-with-code/ --> <title> HTML5 Test Page </title> <style> .wcustomhtml { overflow: visible !important; } .dropbtn { background-color: #a1a1a1; color: white; min-width: 250px; padding: 16px; font-size: 16px; border: none; } .dropdown { position: relative; display: inline-block; } .dropdown-content { position: absolute; background-color: #f1f1f1; min-width: 250px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: 1; } .dropdown-content a { color: black; padding: 12px 16px; text-decoration: none; display: block; } .dropdown-content a:hover {background-color: #ddd;} .hide { display: none; } /* used in new version with JS */ /* original version without JS .dropdown:hover .dropdown-content {display: block;} .dropdown:hover .dropbtn {background-color: a1a1c1;} /* */ /* Might be able to use both hover and click functions by leaving original CSS in and adding new JS version code. Un-tested: Might also be able to combine with separate 'media' setups */ </style> </head> <body> <div class="dropdown"> <button class="dropbtn">Photo Galleries 1</button> <div class="dropdown-content hide"> <a href="http://marleys2019.weebly.com/new-truck.html">Truck Fitout</a> <a href="http://marleys2019.weebly.com/2009-christmas.html">09 Xmas Party</a> <a href="http://marleys2019.weebly.com/40-years.html">40Yrs Surprise</a> <a href="http://marleys2019.weebly.com/hope-valley-opening.html">Hope Valley Opening</a> </div> </div> <div class="dropdown"> <button class="dropbtn">Photo Galleries 2</button> <div class="dropdown-content hide"> <a href="http://marleys2019.weebly.com/new-truck.html">Truck Fitout</a> <a href="http://marleys2019.weebly.com/2009-christmas.html">09 Xmas Party</a> <a href="http://marleys2019.weebly.com/40-years.html">40Yrs Surprise</a> <a href="http://marleys2019.weebly.com/hope-valley-opening.html">Hope Valley Opening</a> </div> </div> <script> function init() { const sel = document.querySelectorAll('.dropbtn'); for ( let el of sel) { el.addEventListener('click', function () { el.nextElementSibling.classList.toggle('hide'); } ); } } init(); </script> </body> </html>
  42. 1 point
    Give the table an alias each time and use that to refer to the different fields so that things aren't ambiguous. e.g.: left join drivers AS d1 ON schedule.dropOffID = d1.driverID left join drivers AS d2 ON schedule.pickUpID = d2.driverID Use the same aliases in the select list to make sure you're selecting the correct columns.
  43. 1 point
    The controls are all different in size and icons depending on browser used. You can create customized controls using images, css, but this will require you recreate each custom button with JavaScript functions to reproduce same results the browser controls provide. google "html5 video custom controls css"
  44. 1 point
    One of them runs in the browser and one of them runs on the server, so no. What you can do is create an ajax request in Javascript and send it to the server with whatever data you want to send to tell the server what to do, and the server sends the response back.
  45. 1 point
    You need more unions to select each level of children if you want to do it all in SQL. Obviously, you're limited to a maximum depth with that. There are other ways to design tables and store paths where you could easily select all descendants or ancestors of a particular node. https://www.slideshare.net/billkarwin/models-for-hierarchical-data You're using the first example he gives.
  46. 1 point
    I wouldn't say that is true, as new features are introduced Firefox is usually pretty quick to implement them. Also if you have the superhuman power to force everyone to use Chrome, go for it! But! Wouldn't be better to use the option of using the grid-auto-row: and grid-template-row: in this order that will end up giving the same result in all browsers.
  47. 1 point
    First! Always check your inputs server-side! Clients can send you whatever the heck they want! The required attributes are good enough for people who wish to use your website legitimately, but you have to be careful of those who don't. To get what you desire, you'll want to create an AJAX request. Its not my usual tactic to hand out code, but if you want it HTML: <FORM NAME="Betrugseingabe"> <INPUT TYPE="submit" NAME="Absenden" VALUE="Absenden" ID="Schaltflaeche1" ONCLICK="send_form();return false;"> JavaScript: function handle_response() { if(this.status == 200){ //Output Success or something? //Redirect? //Something happens if you don't error out } } function send_form() { var the_form = document.querySelector("form"); var formData = new FormData(the_form); var request = new XMLHttpRequest(); request.addEventListener("load", handle_response) request.open("POST", "../cgi-bin/DBinsert.php"); request.send(formData); } Disclaimer: Untested
  48. 1 point
    If you want to start removing possibilities you can do that, but if I saw something that wasn't making sense I wouldn't rush to say that certain things are definitely not the cause. You have indications that it is installed correctly, but I wouldn't switch from "indication" to "proof" too quickly, especially considering the lack of success of some of your past assumptions. That being said, maybe everything is fine and the plugin just doesn't work. I haven't been watching you do everything so I can't say what is or is not likely. So, fix it. Create a second table that is set to the correct character set. Export the data from one table, and then import into the other table. Or, even better, start with clean data and only add your test data. No reason to add a possibility of incorrect data import. The fewer variables the better. This is why people say to create a minimal example showing the problem. The more variables you can eliminate, the easier it will be to figure out. If you have something you suspect might be the problem that you want to test, then test it. Create a test case and test it. Eliminate other variables. In fact, you should start with the absolute minimal setup required and make sure that works. If it doesn't work at all then it's either not installed correctly or it doesn't work. This is another reason to contact the developers or their community, although I would be surprised if it was anything other than UTF-8.
  49. 1 point
    Without syntax highlighting, brace matching and auto indentation, a simple editor like that is not very useful.
  50. 1 point
    Unfortunately this site has no connection with the administrators of w3shools.com, posting this error here, won't receive any attention to fix this error, but I suggest you go to 'About' page on W3schools.com then at bottom of page, click report error link.
×
×
  • Create New...