Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 08/03/2018 in all areas

  1. 1 point
    You will need a identifier for every listing for an image that be associated with that item, then count number of items sent to "available today" if less than or equal to '3' send text, else replace text with image that is associated with it, using the identifier for that item. Good luck!
  2. 1 point
    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>
  3. 1 point
  4. 1 point
    You didn't ask for that! you asked specifically not to allow more than 3 from 'Out of stock.' I already knew that would be a problem as that would prevent any further action from removing from 'Out of stock' listing, thats why I suggested if any item clicked in the 'available items' listing, it should reset the count, but you repeated you just wanted to prevent going above 3. What you would also need is to determine if there was requred total listing as well.in either listing within the if condition. Already mentioned that if ( $('#left ul li').size()==3 ) Is not practical because, yes! it will give allert if size() (Still deprecated and not used anymore) is equal to 3, but WILL still continue if total number of list items exceed beyond 3 without a alert.
  5. 1 point
    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.
  6. 1 point
    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.
  7. 1 point
    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
×