Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 07/18/2018 in all areas

  1. 2 points
    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. 2 points
    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.
  3. 1 point
    var OoScount=0; $(document).on('click', '#out-of-stock li', function() { // right side click OoScount++; if(OoScount <= 3){ var id = $(this).attr('id'); var available = 'yes'; $(this).remove(); $("#available").append(this); $.ajax({ // begin ajax url: "ajax/click.ajax.php", type: "GET", data: { 'id': id, 'available' : available }, }); // end ajax } }); // end right side click OR <div id="right"> <h2>Out of stock</h2> <ul id="out-of-stock" class="enabled"> <li id='2'>bananas</li> <li id='10'>strawberries</li> <li id='11'>mangoes</li> <li id='12'>raspberries</li> <li id='1'>apples</li> <li id='3'>grapes</li> <li id='4'>pomegranates</li> <li id='5'>pineapples</li> <li id='6'>coconuts</li> <li id='7'>oranges</li> <li id='8'>cherries</li> <li id='9'>kiwi fruit</li> </ul> <div class="instructions" id="instructions-add"> Click to add fruits to available list </div>  </div> var OoScount=0; $(document).on('click', '#out-of-stock.enabled li', function() { // right side click OoScount++; var id = $(this).attr('id'); var available = 'yes'; $(this).remove(); $("#available").append(this); $.ajax({ // begin ajax url: "ajax/click.ajax.php", type: "GET", data: { 'id': id, 'available' : available }, }); // end ajax if(OoScount >= 3){ $('#out-of-stock').removeClass('enabled'); $('#out-of-stock').addClass('disabled'); //not really needed but can used to highlight as diabled with disabled cursor for instance } }); // end right side click
  4. 1 point
    You can also get the list of li items in the list and use that to check the count.
  5. 1 point
    Set a click count variable outside 'Out of stock' click function. Within the click function increment the click count variable by 1 for each running of this function, then use an if condition to proceed with removal of an item only when click count is less than a set amount. You could reset the click count variable to 0 if a item is clicked in 'Available today' listing.
  6. 1 point
    This is a public forum, you can show it to anybody. The task is impossible using only Javascript, but do you have access to a server-side programming language?
  7. 1 point
    The fourth problem is that the readAsText method does not return a value. m is undefined.
  8. 1 point
    First, you haven't quoted your string, it should be reader.readAsText("C:\m.txt"); The second problem is that the browser is not allowed to read files directly from your filesystem. The third problem is that the readAsText method does not take a file path string as an argument, it takes a File object. You have to get the file object from a file input as shown in the example on this page: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/onload var file = event.target.files[0]; // ... // ... reader.readAsText(file);
  9. 1 point
    If you look at the example code in the page you linked to, that is inside an event handler for a change event on a file input field. So event.target is the file input. File inputs have a files property that contains the files that were selected. It's not line by line, it's all of it, but yes.
  10. 1 point
    You're still using a temporary table, I don't think there's any reason to, especially if this is a multi-user application. If it's single-user then you could benefit from creating a permanent table and giving it the correct indexes, otherwise there's no point to use a temporary table. select * from ( select acct_num = ser.account_number, customer_type = cac.member_role, full_name = cac.full_name, acc.charge_off_date, external_status = acc.external_status_code_name, coff_reason = acc.charge_off_reason_code, crd.date_status_chg, cac.deceased_code, crd.upc_14, curr_bal = ser.current_balance, cac.cii_code, sys_num = spa.system_bank_identifier from fact.fact_cc_servicing ser join dim.dim_cc_account acc on ser.account_number = acc.account_number join dim.dim_cc_account_customer cac on ser.account_number = substring(cac.full_account, 13, 16) join dim.dim_cc_cardholder crd on ser.account_number = crd.account_number join dim.dim_cc_sys_prin_agent spa on ser.dim_cc_sys_prin_agent_key = spa.dim_cc_sys_prin_agent_key where ser.end_date = 99991231 --gives the current record from the fact table and acc.external_status_code_name = 'charged off' and acc.charge_off_date between 20180101 and 20181231 and ser.current_balance >= 600 and cac.member_role = '01' ) AS tmp where (sys_num = '3616' and isnull(cii_code, '$') in ('E', 'F', 'G', 'H')) or coff_reason = '68' If you want to order the results, order the outer query, there's no reason to order the inner one.
  11. 1 point
    I don't know if you have an option to make the file read synchronous. You can make an ajax request synchronous, I don't know about file reads. If you did that the browser would freeze until that operation finished. If you only want to read a file for the purpose of accessing the file, or just for fun, you don't need a load handler. If you want to actually do any work with the actual data in the file then you get that data in the load handler, it is not available before the load event. I mean, you can do this: var file = event.target.files[0]; var reader = new FileReader(); reader.readAsText(file); That will read the contents of the file, and it doesn't require a load handler. But your code has no access to the contents of the file.
  12. 1 point
    I don't know, I'm not an expert with the registry. I would suggest restoring the settings manually by editing the keys again instead of importing. If you want to know what the previous values were, open the registry file in a text editor.
  13. 1 point
    The bizarre character has magically disappeared, but with not without a trace. For, I now see where a correction that I made in regard to the coding of the Gate Seven webpages has likely made a difference. For now, Gate Seven is working appropriately, but the Gate Seven data still appears under Gate Two. I will likely have to go into the Matomo database and remove it manually. The magical nature of what has occurred is apparently created by a Matomo time lag. What it calls today is actually yesterday. Another Matomo mystery that I will someday have to address. In any case, I am not as bad a coder as I sometimes think myself to be. Then too, it was never my goal to become one. I am becoming one by default. If Grammar Captive does not sail, then I can write code manuals and help others to overcome the frustration that Matomo has created for me. Have a great day! And, once again, thank you for your patience. Roddy
  14. 1 point
    Right. If this were my server, I would probably dig into the PHP files that are handling that cURL request to figure out what it's doing, or go through the database to see what I find.
  15. 1 point
    Learn about relative paths... https://www.w3schools.com/htmL/html_filepaths.asp Also another common problem is that when testing on a Windows pc the paths and file names are not case-sensitive -- but then you transfer the file to a Linux server which is case-sensitive.
  16. 1 point
    Like I said just by entering ' mywebsitename.com' domain refers to a folder called 'mywebsitename.com/httpdocs/' in the background, you don't need to enter 'httpdocs/' at all!. Anyone entering mywebsitename.com will is directed to 'mywebsitename.com/httpdocs/' folder because that is where all your website folders and files are placed. So replace all references to 'mywebsitename.com/httpdocs' with 'mywebsitename.com'. Also you should not use a ftp reference at all, that is a File Transfer Protocol used for you guessed it! FILE TRANSFER! it should be Hyper Text Transfer Protocol as in 'http://mywebsitename.com/img/elc.jpg'
  17. 1 point
    Use display: flex with a custom class, as it seems w3css doesn't provide class to do the same https://www.w3schools.com/code/tryit.asp?filename=FTEFHOI27J7C
  18. 1 point
    Your default root folder is 'mywebsitename.com/httpdocs/' this is where all your website files are placed, entering 'mywebsitename.com' domain address in browser window address bar should take you directly to the root folder index file which will be your home page. Folders added to this root folder such as 'img' are accessed by adding that folder name to you domain website name i.e mywebsitename.com/img will take to that img folder, then by adding the file name 'elc.jpg' should access that image file i.e 'mywebsitename.com/img/etc.jpg'.
  19. 1 point
    The resource is the file to open. Loaded means it has been read.
  20. 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
  21. 1 point
    If it's Windows, I suppose you need to change the file type to a .exe so that Windows tries to execute it when you double-click on it. If you're typing commands into a console you just type the name of it, as long as it has execute permission. This is where we talk about trying to divine some sort of meaning from binary data: http://w3schools.invisionzone.com/topic/57997-knowing-what-is-the-hex-number/ Again, we've already talked about this. It's binary data. Just because you're opening it with a program that tries to display everything as text doesn't change the nature of the file.
  22. 1 point
    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 like shopping cart images etc.
  23. 1 point
    Strange... I don't understand how this happens :S However, I downloaded the laters version of the template. Got the latest versions of the files.... now it works!!!
  24. 1 point
    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.
  25. 0 points
    Non of those prevent the 'out of stock' function running and removing list item and adding it to 'available today' listing. You don't want to stop the click and function running, but only the code that removes/add when a certain condition is met. That IF condition is when the count of how many times the remove/add function is triggered and if it is 3 or greater, this condition will process or bypass the remove and add processing. You are looking for this code NOT being processed if count >=3 var id = $(this).attr('id'); var available = 'yes'; $(this).remove(); $("#available").append(this); $.ajax({ // begin ajax url: "ajax/click.ajax.php", type: "GET", data: { 'id': id, 'available' : available }, }); // end ajax NOTE: .disable only works on form elements, also size() is no longer used, instead 'length' is used, and using this won't help as it gives total of items not how many added or removed. It would only work if you first identify the total number of items in 'Available today' OR 'Out of stock' and apply to a variable like totalAtStart then compare that on each removal or addition if that total is greater of less that the number store in variable totalAtStart -3 or +3 the set value.
×