Jump to content

justsomeguy

Moderator
  • Posts

    31,575
  • Joined

  • Last visited

  • Days Won

    77

Everything posted by justsomeguy

  1. Are you running this locally or with a web server?
  2. Try this instead: document.cookie = name+'=; Max-Age=-99999999;';
  3. 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
  4. Why are you using a for loop at all? It's an array with a single value in it, you don't need to loop. And if there's nothing in $_SESSION, then it won't loop to set the value at all.
  5. Does it clear out the value after you try to delete it?
  6. Have you gone through the Javascript tutorials? You'll need to use a lot of Javascript to build a game. Also probably a canvas.
  7. The sum would come from another query, although depending on which database you're using you can probably use subqueries to group the results from multiple queries into one result set.
  8. From the manual: u (PCRE_UTF8) This modifier turns on additional functionality of PCRE that is incompatible with Perl. Pattern and subject strings are treated as UTF-8. An invalid subject will cause the preg_* function to match nothing; an invalid pattern will trigger an error of level E_WARNING. Five and six octet UTF-8 sequences are regarded as invalid since PHP 5.3.4 (resp. PCRE 7.3 2007-08-28); formerly those have been regarded as valid UTF-8.
  9. Add the u modifier to your pattern: /[^A-Za-z0-9!\"#%£&()=@\s]/u
  10. There's not enough code there to suggest much. What does the form look like? What data is sent in $_POST?
  11. What about the original string? Is the 194 part of a code point that only gets partially replaced?
  12. You can use a case expression: https://docs.oracle.com/cd/B19306_01/server.102/b14200/expressions004.htm SELECT CASE bool_field WHEN 0 THEN 'No' ELSE 'Yes' END ...
  13. Why Flash? Native support for HTML 5 is widespread enough, and Flash is blocked on enough devices, that using Flash these days doesn't make much sense.
  14. I don't know why that would matter. The input has a unique ID and you're using that to focus it, right? Make sure to check your browser console for error messages.
  15. If the Javascript code is in the head, and it needs to interact with elements on the page, yes you need to run it after the page loads.
  16. justsomeguy

    123aaa

    I would just combine that into one query, I'm not sure what [MSCRM].[dbo].[Filtered] is supposed to be, but apparently it's not that. SELECT Pipeline, SUM(FY20), SUM(FY21), SUM(FY22), SUM(FY23), SUM(FY24) FROM (SELECT TOP (1000) CASE WHEN big_status = 913800000 THEN 'Active' WHEN big_status = 913800001 THEN 'Inactive' WHEN big_status >= 913800002 THEN 'Pending' WHEN big_status <= 913800006 THEN 'Pending' ELSE 'Closed' END AS Pipeline ,[big_fy20revenue_base] AS FY20 ,[big_fy21revenue_base] AS FY21 ,[big_fy22revenue_base] AS FY22 ,[big_fy23revenue_base] AS FY23 ,[big_fy24revenue_base] AS FY24 FROM [MSCRM].[dbo].[Filtered] WHERE (big_unitname='Projects' or big_unitname='Products' or big_unitname='Strategy') AND big_revenue = 'External Revenue' AND statecode = 'Open') AS tmp GROUP BY Pipeline
  17. I would use ord or mb_ord to loop through the characters in the string and print the value of each byte to see what's actually there. https://www.php.net/manual/en/function.ord.php https://www.php.net/manual/en/function.mb-ord.php
  18. You can target the input element and use the focus method, e.g.: document.getElementById('search_input').focus();
  19. 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.
  20. If you need it to be an input, then why print "NA" at all?
  21. I wouldn't target myBtn for DOMContentLoaded, I would just use the code I posted and put whatever code you want to run when the page is loaded in that event handler.
  22. You can use the DOMContentLoaded event: document.addEventListener("DOMContentLoaded", function(){ // code to run when the DOM is fully loaded });
  23. All of that Javascript needs to go in a ready handler. When the browser executes the code in the head, it has not set up the body of the document yet, so that myBtn element does not exist. That's why you use a document ready or load handler, it waits until the document is finished loading and ready to run the rest of the code. Any code that interacts with any element on the page needs to be in a load handler, or at the end of the body. Once the browser gets to the code at the end of the body it has already created everything else. If it's in the head and trying to work with elements on the page it needs to be in a load handler.
  24. Sure. You can also attach the event directly through using addEventListener instead of using the onload attribute in HTML.
  25. https://www.w3schools.com/jsref/event_onload.asp
×
×
  • Create New...