Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation since 09/07/2011 in Posts

  1. That was the days of html4 with strict doctype no longer supporting it, it was my main gripe as there was not cross browser support for anything else similar, so you had to use transitional doctype which allowed iframes. Then whoever realised what a major blunder they made, and it was resupported in html5
    2 points
  2. 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 points
  3. 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-w
    2 points
  4. 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 points
  5. class whatever { function func1 { do stuff } function func2 { do stuff } } object = new whatever(blah,blah2); object->funct1(); object->funct2();
    2 points
  6. Gosh! you and rizwansyed must be working with identical school exercise book, both working with a circuit board, communicating with server and file on sd card, and now same identical form inputs requiring the SAME effect on selection, must be biggest coincidence in the whole milky way galaxy. hmmm Also you could use required attribute that will give a warning that selection is required if first option has empty value.
    2 points
  7. Regardless of native JS or JQuery, perhaps this would help with your understanding: <script> var globalVar = 'globalVar'; function parentFunc() { // no function parameters var parentVar = 'parentVar'; function childFunc() { // not function parameters var childVar = 'childVar'; alert('childFunc has access to:\n'+childVar+'\n'+parentVar+'\n'+globalVar); } childFunc(); alert('parentFunc has access to:\n'+parentVar+'\n'+globalVar); } alert('body has access to only:\n'+globalVar); parentFunc(); </script>
    2 points
  8. I tested and the scoped attribute does not work. According to MDN, Firefox should support it, but it also says that the attribute is deprecated so it's best not to use it. Since the scoped attribute is deprecated, <style> elements should only go in the <head> section of the document.
    2 points
  9. No one has to use your form, if you have a page that accepts input from $_GET or $_POST anyone can send anything they want to that page. Make sure you validate your inputs.
    2 points
  10. By changing the prototype of a data type, you change every single object of that type. In this example, they are changing the prototype of the String object so that all strings have a trim() method. The trim() method removes spaces from the beginning and end of a string. The code you see in the replace() method /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g is called a regular expression, it is used to do complex manipulations with strings. There is a tutorial page about regular expressions here: https://www.w3schools.com/js/js_regexp.asp
    2 points
  11. To be responsive, you shouldn't us a fixed width using px, unless you use media queries to adjust width and html content structure as the device increases or decreases. You are using max-width: on wrapper div, which makes this element responsive up to a specific max-width. Most responsive sites use percentages widths for inner html structure within the fixed width container element, these also will use media queries to change from 3 to 2 to a 1 single column structure for mobile devices. Once this responsive page is working as it should, you can then think about adding all the other features l
    2 points
  12. No. UPDATE is what you use to start an UPDATE query when you are updating the table. It is not a command on its own. You might be thinking of commit, but you only need to commit if you're using transactions, which it doesn't look like you are. When you insert a record outside of a transaction there's nothing else you need to do to actually insert the record, just the insert query will do it. My condolences.
    2 points
  13. The purpose of an object template, such as "Person" is for organizing code. In any part of your software, if you are given an object of type Person you know for sure that you can find a name and age property on it. If the object has no type then you don't know what properties it might have. You would use an object template if your software uses the same kind of object a lot. If you're only using the object in one place then you can use the shorthand {} to define it.
    2 points
  14. Included files must have <?php ?> blocks around the code.
    2 points
  15. There's nothing formal to tell you things like that. People do it themselves, and it tends to illustrate the Dunning-Kruger effect. People who just recently started tend to rate themselves highly, and only when you get more into something do you realize how much you don't know. I wouldn't put any weight on things like that. If you want to evaluate someone's capabilities look for a portfolio or things they've actually finished.
    2 points
  16. 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.
    2 points
  17. You had wrongly referenced a JavaScript function, and wrongly named a css selector so very important position: relative was not applied. <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> * {box-sizing:border-box} body {font-family: Verdana,sans-serif;margin:0} .mySlides {display:none; width: 100%;} /* Slideshow container */ .slideshow { /*NOT slideshow-container*/ max-width: 1000px; position:
    2 points
  18. I don't know where there's a list. Generally you should never develop for specific devices, you should just make your layout flexible enough (with help of media queries) to wotk on any screen regardless of size. This is usually achieved by testing your page in the responsive mode of your browser and resizing the viewport until it breaks, then you add a media query to correct the layout. But for reference, I start off with a design for the following devices, then make extra adjustments later: Small mobile (iPhone 4):Up to 374px (I usually use this just for specific elements that did
    2 points
  19. Like astralaaron said using closest class and the index class in jquery you can get the index of the tr, have a look at the fiddle. https://jsfiddle.net/8hL46ftj/ hope this helps $('img').click(function(){ alert($(this).closest('tr').index()) })
    2 points
  20. I have a doubt from the 'W3Schools' JS Tutorials, It is given below. The 'var y=123e5' produces 12300000.And 'var z=123e-5' produces 0.00123I did'nt understand what 'e5' and 'e-5' are stands for and how formed 12300000 from '123e5'and 0.00123 from '123e-5' ? The code given below. <script type="text/javascript">{var y=123e5;var z=123e-5;document.write(y+"<br/>"+z);}</script>
    1 point
  21. Hello @leela52452, dir attribute is used to set the direction of the text within an element in an HTML document. If you set it as an RTL then it will display HTML from right to left. It generally used when language is like Arabic etc. dir attribute is not a compulsory attribute so you can also skip this.
    1 point
  22. Well, think about that question. All you have is a sequence of hex digits, right? Is there any other information there? Is there anything other than the actual hex digits? Because if there's not additional information about how to split that up or which digits go with each other, then is there a way to get any other information at all about the hex digits? I mean, take hex out of the equation if you want to. Here, base-10 digits: 513857634343546894648435486743543634 Now, if I tell you that the above is 3 numbers that are concatenated, how do you know what those 3 are? Is t
    1 point
  23. You need to process both, and return data from both as a single encoded JSON format .
    1 point
  24. The act of adding the new HTML content (it does not matter that the content came from somewhere on the page) causes the browser to execute whatever Javascript is in there. The Javascript that is in there tells it to replace the HTML content again, and that keeps happening until the browser gives up. The position of the PHP code is not relevant as far as the browser is concerned, the position of the Javascript code is relevant. Don't put the Javascript code to do the replacement inside the HTML that gets added, it needs to go outside of the element that you're copying. Now, if yo
    1 point
×
×
  • Create New...