Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by Irate

  1. Suuuuure. By the way, congratz, it was about time.
  2. Hello everyone, it's been a while since I last made a topic, but here we go. So, to start, I am working with TYPO3 right now - to be exact, I am modifying an extension for someone - and I want to assign certain variables I can access with placeholders, but I have not worked with SQL in a while and since I have been here for a while, I figured I might as well ask you guys. I am grabbing entries from the table brandings which has three columns: one is called "brandingTargetPath", the second one is called "user" and the last one is "when", where the first two will be varchar(255) and the last one is int(11), with the table having an auto-increment Primary Key called "uid". Now, I can select the rows I want to and use "SORT BY when DESC" to get the most recent entries first, but then I want to differentiate between the different "brandingTargetPath" entries and show only the most recent entry in a certain path (the possible paths will be provided by PHP). Could anyone just hint me at the direction which SQL commands I should use? That'd be great, I can sort out the rest by myself. Thanks in advance, Irate
  3. Just add E? after the S.
  4. Or just use regular expressions if you don't want to convert to lower-/upper-case and then back to the original state. You can't dynamically create regular expression literals, so you have to use the /* new */ RegExp() constructor (the new is actually optional as it will work the same either way).
  5. Just a quick suggestion (more like urging you to do it), use jQuery for anything even remotely related to Ajax. It makes everything a lot easier. If getkm.php works fine, then you might call it like this with jQuery: $.get('/getkm.php'{b:postcodebeginww,e:postcodeeindww},function(data){}); In the function(data){} part you handle the response. You could use .done(function(data){}), too, whichever you prefer. And look uo the jQuery documentation in general.
  6. How about using [^\w $\-] The \w in a synonym for [a-zA-Z0-9_], so this saves you a few valuable characters (if you're writing compressed and/or minified code.
  7. Actually, the selector "td.my class" looks for an XML tag named <class> which is a child of a <td> element with a class of 'my'. Class attributes in HTML can be space-separated lists of class names, so as to assign multiple class names to an element. Do you literally have <td class="my class"> in your HTML? If so, try querying $('td.my.class').
  8. Ajax is just a scripted HTTP-Request "module" JavaScript contains. It does not provide anything else on its own, just, as I said, a way to asynchronously fire HTTP-Requests. In some cases, you just have to bite into the sour apple and not support IE beneath 10. It's not uncommon, actually. You could use Shockwave Flash to embed animations on IE, if you want to, though.
  9. Two things. 1. If I see a huge block of code without any proper formatting ( /* code here */ helps a lot), I usually don't even start to bother reading all of it. 2. You're already using jQuery which provides the most cross-browser comfort a JS framework has to offer. If it doesn't work with jQuery, it probably doesn't work at all in IE.
  10. If you have created the output file, I suggest you use fopen, fgetcsv, feof and fputs or fwrite.
  11. I guess I was being misunderstood... I could ask my school's sysadmin for help, that's what I meant to say.
  12. The HTML comment works for all IE versions which are lte 8, where lte is "less than or equal". If you need a more general condition, use <!--[if IE]>...<![endif]-->. Other possible variants are lt IE n (where n is the version number), gt IE n, gte IE n and !IE (for NOT IE). Edit: Got my BBCode wrong.
  13. The syntax looks widely correct to me. Are you sure you got the right language for your assignment / for what you need? As Xaotique said, this is JavaScript, not Java.
  14. You could try using .jsp files for that purpose, no dire need to do it with PHP, I reckon. Besides, PHP provides a lot of handy OOP stuff, so why not use it?
  15. $("input[type='password']:eq(0)").on("change",function(){ var next = $("input[type='password']:eq(1)"); if(!next.val().trim()) return; if(next.val()==$(this).val()) // passwords match, do something $(next).addClass("correct-pass"); else $(next).addClass("wrong-pass"); }); $("input[type='password']:eq(1)").on("change",function(){ var prev = $("input[type='password']:eq(0)"); if(!prev.val().trim()) return; if(prev.val()==$(this).val()) $(this).addClass("correct-pass"); else $(this).addClass("wrong-class"); }); It's just an example of how to implement that. There's some other ways, too.
  16. Of course... There's a way to do that just with HTML, too (but it's disfavoured by the W3C, so use something else than HTML if you). <!--[if lte IE 8]><meta http-equiv="refresh" content="0; http://urlhere.com/file.htm"><![endif]-->And the version with JS. <!--[if lte IE 8]><script>window.location="http://urlhere.com/file.htm";</script><![endif]-->
  17. No need for CCs. <!--[if IE]><style>/* this style will only be loaded for IE */</style><![endif]-->
  18. My school network uses LDAP on a Squid server if I'm not mistaken... I can ask for some help, I guess?
  19. Try using <p> for block-level elements containing short text... that's what <p> (paragraph) is there for, actually.
  20. RegExp for the 2nd question would look like this... #S[\d]{5}/[\d]{4}# As for the RegExp you posted, you can use commonly used shortcuts, like [\w] instead of [a-zA-Z_-], I think that'd help you somewhat. Edit: Forgot a backslash.
  21. Try console.log(_idwork), identifiers are unique and case-sensitive in JavaScript.
  22. Redacted. Noticed I was answering a different question than what was asked.
  23. You're validating forms? Use the server-side solution (you could also use server-side JS for that, though). php.net has all of the Math functions documented. Do not look any further than that if that's all you need.
  24. Just to grab up the point of your last paragraph... jQuery makes everything easier, but if you're really, really, really (and I mean really) concerned about your page load and those few milliseconds it takes to load jQuery from Google APIs (or directly from code.jquery.com), then using vanilla JS is often the more straightforward approach (but nevertheless more verbose; it also doesn't provide very useful utility functions).
  25. You made a syntax error at Math.max(count-35;0) (bolded the mistake for you). Besides, checking the maximum out of any value and 0 is basically pointless unless you know for sure that you're going to use negative values... Oh, use Number.toFixed(d) where d is the amount of decimal spots you want to have (the function may round up or down if you're near to an integer value). Edit: looks like I forgot that the ic code prevents BBCode from being parsed. Hah. Also, all of this is pretty basic work which could easily be found in Google.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.