Jump to content


Popular Content

Showing most liked content since 10/22/2016 in all areas

  1. 2 points
    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. 2 points
    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 didn't fit) Mobile or small mobile in landscape): Up to 767px Tablet portrait: 768px Tablet landscape: 1024px (breakpoint usually between 800px and 900px) Desktop: 1025px and above Some people make designs for large desktop computers (1440px and above), but that's up to you. In general, there isn't one specific strategy for responsive design, this is just the approach from the companies I work with.
  3. 2 points
    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()) })
  4. 1 point
    You can use a php function called is_numeric(). if(is_numeric($var)) { //do stuff } else { //do other stuff } Hope this is what you want.
  5. 1 point
    The slideIndex will always be 1; When function called var slideIndex = 0; then further on slideIndex++;
  6. 1 point
    If $(this).attr('id') returns the correct ID, then this (and the jQuery-wrapped $(this)) refer to the same element. There's no reason to get the ID from the element, then get the element again. You already have it, you're getting the ID from it.
  7. 1 point
    You're telling to find an element with the ID "podType". If you want to use the value of the variable, you need to specify that. $('#' + podType)
  8. 1 point
    The issue isn't the location of the files relative to each other, it's how you're accessing them. If the URL bar in your browser starts with http:// or https:// then your browser uses one security model, if it starts with file:// or anything like that it uses another. I don't know if ajax even really works for non-HTTP requests, because part of that process is communication with a web server. It might work, but I wouldn't count on it. If you want to download a server for testing, the easiest are packages like XAMPP. That includes the Apache web server, and also PHP and MySQL and some other tools pre-configured. After you install that and start Apache, you'll be able to access it at http://localhost/ There will be a specific folder on your computer that Apache uses as the document root, that's where the root level of your website is. So if you create a file and save it in that folder as index.html, you can access it at http://localhost/index.html, or if you put a folder called images in the document root then that will be at http://localhost/images/ etc
  9. 1 point
    The page is reloaded because you are clicking a link which will call itself because no other url is requested, but! the current page url will have the querystring attached to it as well. When the page reloads if this page has php code that will check and read the name and value transferred with the querystring using $_GET[], this value can be passed onto a php variable. Yes! you should sanitize, as it is a querystring viewable and editable from address bar. You could prevent page reloading by using JavaScript, then by using AJAX, process the data from external php page and return result.
  10. 1 point
    Just to clarify, if the link is a query string only and does not contain the rest of the URL, it uses the current URL of the page with the new query string.
  11. 1 point
    That's because you set it to false right before you alert it. Go back and look at the code I posted, notice how the variable definitions are outside the load handler. They first get defined with those default values, maybe at some point later down the page PHP will redefine them, and then once the page finishes loading the rest of the Javascript runs, using either the default values or the values that were set by PHP.
  12. 1 point
    Why should it hide? there is nothing there to cause it to hide.
  13. 1 point
    Like I said though, with a 1-to-1 relationship you usually put all of that in one table. It's not normal to have a primary key that is also a foreign key.
  14. 1 point
    The idea of a foreign key is that the database would not allow you to enter a non-existent order_number in your cust_time table. It would only accept order_numbers that already exist in the customer table.
  15. 1 point
    .et_pb_row_1 { max-width: none; width: auto; }
  16. 1 point
    Try last suggestion I added in my post before this one, the previous will work if changed to post method but you would use $this_order = $_GET['order_num']; //would retrieve value of $order_num $this_test = $_POST['testing'] // would retrieve value of 'Edit' because you are using get the input value will overwrite the one set in action (unless you add a '&' at end to include both)
  17. 1 point
    dsonesuk is referring to using <a> tag. Like: <a href="edituser.php?cust_id=n">Edit User</a>
  18. 1 point
    Send it as GET querystring with customer number edituser.php?cust_id=n where 'n' will be the customer number.
  19. 1 point
    What do you mean by encoding your php code? All i know is encoding charachters (UTF-8 etc) or json_encode(). What should your encoded code do?
  20. 1 point
    If you use any of the date types in mysql database it should save it as 'YYYY-MM-DD' only, if you save as text string you should be able to save as you want it. but! IF you wish to do calculations through MYSQL query's it expects the format to be as used by date types, OR if calculation of dates through PHP, it expects if year month and days used be be 'YYYY-MM-DD' formatting type with exception of hyphens where slashes could be used. Of course you could retrieve specific date ref from custom text string date, and put them in correct order for calculation, but that means more work, whereas you could reformat the database date on output to a page. http://w3resource.com/mysql/date-and-time-functions/mysql-weekofyear-function.php
  21. 1 point
    I don't know how the recent forum update gets parsing so wrong, but this is what I had for that last part, I didn't have any nested quotes. I'm not sure what you mean. There's only 1 kind of cookie as far as browsers and servers are concerned. The session cookie in PHP is just another cookie, like any other cookie, with all of the same options available to it as any other cookie. You can configure the settings for it just like you can configure the settings for any other cookie you want to set. I don't know, it's probably left up to the browser vendors on how to handle that, I doubt that behavior is defined so specifically by any specification. It wouldn't matter if the session_start function is used, because again the browser doesn't know anything about PHP. What would probably matter is if the browser has anything open to a URL that matches the settings for those cookies. But I don't know if they will immediately delete temporary cookies just when the tabs to those URLs have been closed, or if they wait until the entire application is closed. I assume it's the latter, because vendors probably think that someone might have mistakenly closed a page, and they would expect that if they open the page again then their session is still active. Browser vendors probably think that would make more sense to a user. Yeah, one of the steps in the process is to get the session ID, but that doesn't mean that the session_id function is the only step in the process. The role of the session_id function is only to get or set the current session ID, not get any session data. Other functions do that. Moreover, the programmer does not need to call session_id manually if all they're trying to do is get the session data, all they have to do, again, is call session_start.
  22. 1 point
    Unless you actually echo out the username, password you won't see these.
  23. 1 point
    My mistake, used for testing forgot to remove. change slideIndex = parseInt(z[j].getAttribute("data-currentslide")[0]); to slideIndex = parseInt(z[j].getAttribute("data-currentslide")); //lose the [0]
  24. 1 point
    You need to add the second parameter when you call currentDiv, like you did with plusDivs. In order for the function to highlight the correct dot, each of those dot elements needs to specify which slide show it belongs to, so that showDivs can get the correct set of dots. One way would be to add a class name or data attribute to the dot container elements, or to the dot elements themselves.
  25. 1 point
    var a = ["123", 123, "1a2b3c", 122.222, "A"]; for(var i=0 ; i<a.length ; i++){ if(isNaN(a[i])){ alert('a['+i+'] is not a number (nan)'); } }
  26. 1 point
    Are you sure you used enough tags for this post? If you want to know if something will work offline, it will help to know what that something is. What does it do that you don't think will work offline? If it's using server-side languages then you'll still need to have a local web server installed (or put it on a server on the network).
  27. 1 point
    Really? maybe is a Spain hosting problem, because they show how to install here https://help.1and1.com/hosting-c37630/webspace-and-access-c85098/ssh-c37775/install-imagemagick-via-ssh-a649013.html
  28. 1 point
    div>p {background-color: yellow;} Will set paragraphs that's a direct child element of parent element div with background yellow https://www.w3schools.com/cssref/tryit.asp?filename=trycss_sel_element_gt it won't change paragraphs nested within other child elements of the div parent. div p {background-color: yellow;} will change ALL child paragraphs within parent div whether they are nested or not. :root will target the <html> element, it being the outermost containing element (root) * universal selector: meaning target ALL elements. : single colon used for pseudo classes such as :hover, :link, : visited :: used for pseudo element ::after, ::before used to create content before or after a elements content, NOTE: older IE browsers use the single colon, but both can be used for modern better browsers than IE and Edge.
  29. 1 point
    I have a issue and there might be multiple ways to solve it. I want a button to reveal extra content when it is clicked. I want to slide the extra content in from the left using the w3.animations or any other method that would be easy to follow and have it stop in the center of the screen. The content is a image and a few words describing it in a organized container. How would I do this or do you have any general advice for me to follow?
  30. 1 point
    toGMTString() -> Deprecated. Use the toUTCString() method instead, as stated from here https://www.w3schools.com/jsref/jsref_obj_date.asp
  31. 1 point
    If you're going to ask the same question, then it's going to be the same answer: If you don't want to use PDO and have it throw exceptions when you make a mistake, then you need to check for errors yourself. If prepare returned false, then you need to print the error message from MySQL. You have a problem with the SQL query you're trying to prepare. You changed the format of that UPDATE query between the two pieces of code and now the query is wrong. UPDATE queries do not use the same format as INSERT queries.
  32. 1 point
    Upon refreshing, the video is still uploaded to database ? Not the folder, because i might be thinking that it displays you the page because in database there is a video saved with an url but on your host in the videos folder there is no video with the url from db, that's mostly why you have that error.
  33. 1 point
    No! the PHP file in its present state should not be included in to the form page, it is AJAX specific because of the if condition, which should be access by JavaScript AJAX code that uses url to that php file to retrieve required data using server script language PHP. I don't know what jquery.js is? is it the users own custom code or jquery framework code? either way it is perfectly all right if not the norm to place js code at bottom of page, as it will help in loading of page quicker as html and css needs to loaded primarily first, and JavaScript secondary as most of the time JavaScript is triggered by events by the user after the page is fully loaded. The main problem with include ("jquery.js"); is that is needs to be within <script>...</script> tags if custom js code, OR if jQuery framework file, it should link to it, using for example <script type="text/javascript" src="jquery.js"></script>
  34. 1 point
    There is no action attribute in the following line of code <form id="form" method="post"> You must enter an URL for ajax_comment.php as the value of your action attribute in the above <form> element. <form id="form" method="post" action='pathto/ajax_comment.php'> Replace the word "pathto" with whatever is necessary to connect the document that contains your form with the document that processes your $_POST variable -- namely, ajax_comment.php.
  35. 1 point
    PHP extension is required if you need to process data sent from form whose method is post or get using $_POST, $_GET, or $_REQUEST. IF its action is a link to another php page, then the form page can remain html, if it is sent to itself then the form page should be php.
  36. 1 point
    No! the alt attribute is not useless, it may be useless for those with normal sight, but for those without sight who use a 'screen reader', or hard of hearing it is a necessity.
  37. 1 point
    If they are child element of parent div, you need to add space before child elements. $( id + 'textarea') will look for an element with id '#letter_abstracttextarea' $( id + ' textarea') = '#letter_abstract textarea' will look for child textarea element whose parent element has this specific id.
  38. 1 point
    Here's the fix for MS kak, you would have thought they would have known better by now. // Close the dropdown if the user clicks outside of it window.onclick = function(e) { /*because of MS god complex thou shall do it how I WANT, and not how every else wants, which I thought they had finally begun to see the light, but apparently not! we have to allow for MS kak way of doing things*/ matches = e.target.matches ? e.target.matches('.dropbtn') : e.target.msMatchesSelector('.dropbtn'); if (!matches) { var myDropdown = document.getElementsByClassName("dropdown-content"); for (var i = 0; i < myDropdown.length; i++) { if (myDropdown[i].classList.contains('show')) { myDropdown[i].classList.remove('show'); } } } };
  39. 1 point
    I use Netbeans, because its not limited to just 1 or two server languages, but several, including frameworks Zend, smarty, Laravel, Java etc, It gives you traffic light indication to highlight errors in red and warnings in amber, it gives hints, in indicates what closing braces elements belong to. There is also Sublime, but I found Netbeans gives me what I want, and the ability to add more if I want.
  40. 1 point
    If you're sending string values in the URL then you'll also want to use the encodeURIComponent function to make sure the values don't break the URL. Otherwise, if you're sending a lot of data you'll probably want to just switch to a post request instead of a get request.
  41. 1 point
    Use block elements, or turn them into block elements using display: block; or display: inline-block;
  42. 1 point
    Then all you require is to have images with the rank name that matches the written rank, then using same principle you just supply image path which can be set to a constant variable and then the img file extension. You probably need to be more specific on the img element targeted, but you could use 'fruits' class name index, to target a class name given to the rank img index ref.
  43. 1 point
    var SelOrderArray=[]; $.each($selected,function(i){ //loop through selected possible multiple selected options if(SelOrderArray.indexOf($selected[i]) === -1){ //if current looped through $selected value not in array then add to array SelOrderArray.push($selected[i]); } }); // loop through ordered array of slected options $.each(SelOrderArray,function(i){ //clone element with specific id to temp storage variable var TmpDivClone = $("#"+SelOrderArray[i]).clone(); //remove current existing element with specific id $("#"+SelOrderArray[i]).remove(); // prepend temp cloned element to div #result wrapping mydiv1 elements so prepending remains below dropdown and show TmpDivClone.prependTo('#result').show(); }); Not tested, written on tablet
  44. 1 point
  45. 1 point
    With the code I provided, it does not require being placed in function, it runs its own anonymous function if a specific classed element within a specific parent id element is clicked even if a specific currently classed element already exists OR is newly created which is what 'on()' is specifically used for.
  46. 1 point
    Events like these are applied to elements on loading of the page, if you place them in a function you apply the exactly the same event with same outcome again everytime the function is called, very inefficient, generally if these are placed in function you are doing it wrong. You don't even require the function, you just need to target the parent and then the newly created class references. function addFlowLine() { var table = document.getElementById("query_content_unexe"); var row = table.insertRow(0); row.insertCell(0).innerHTML = '<button class="up">up</button>'; row.insertCell(1).innerHTML = '<button class="down">down</button>'; row.insertCell(2).innerHTML = 'add'; } $("#unexe_table").on("click", ".up, .down", function() { var row = $(this).parents("tr:first"); if ($(this).is(".up")) { row.insertBefore(row.prev()); } else { row.insertAfter(row.next()); } });
  47. 1 point
    If you want to use a database as the data store then that's one route to take, but if the data is static then you could get away with a CSV file or something. You wouldn't even necessarily need to use a server-side language like PHP to build the table (although you could), you could just send an ajax request in Javascript to get the CSV file and parse it in Javascript and go through it to build the table dynamically. Once the table is built and on the page then you'll probably just want to use a jQuery plugin or something for sorting and filtering.
  48. 1 point
    I would look into jquery's closest() function which will search up the dom until it finds what it is looking for. Once you found the tr I think you could use jquery's index() index function closest() https://api.jquery.com/closest/ index() https://api.jquery.com/index/
  49. 1 point
    var acc = document.getElementsByClassName("accordion"); for (var i = 0; i < acc.length; i++) { acc.addEventListener("click", accordion); } function accordion() { for (var i = 0; i < acc.length; i++) { // Reset all of the elements but current selected if (acc.item(i) !== this) { acc.classList.remove("active"); acc.nextElementSibling.style.maxHeight = null; } } //check if current selected has 'active' class and remove it and next sibling, else add and show next sibling if (this.className.indexOf('active') !== -1) { this.classList.remove("active"); this.nextElementSibling.style.maxHeight = null; } else { // being a new selection and not a currently active selection add active class // Toggle the "active" class for the current item this.classList.add("active"); // Make the contents visible var panel = this.nextElementSibling; panel.style.maxHeight = panel.scrollHeight + 'px'; } }
  50. 1 point
    You should add Notepad++ to that list.