|
| Is this syntactically correct? * dnm (i=dnm@113.sub-70-220-238.myvzw.com) has left #rails If ($('cart').innerHTML.match(/No items/)) { What's the tolower function in JS? If ($('cart').innerHTML.toLower.match(/no items/)) { That doesn't work, nor does tolower It's toLowerCase Er, no it's not Sigh |
| Kopilman: yes it is toLowerCase () |
| Apparently that doesn't work on innerHTML $('cart').innerHTML.toLowerCase |
| Doesn't toLowerCase return the lower case version? Not alter the string in place? |
| Yeah, it doesn't operate on the string, it returns a string value |
| Either way it's not a method of innerHTML Oh So toLowerCase($('cart').innerHTML) ? |
| No |
| Kopilman, $('cart').innerHTML = $('cart').innerHTML.toLowerCase() |
| I'm telling you it's erroring. It's telling me toLowerCase is not a metheod of innerHTML |
| Oh. |
| F it. I'll match it on case |
| It's a String method, so maybe you need to cast it to a string |
| I'm not sure how to typecast in js |
| I have lots of ridiculous ideas |
| Kopilman,I think you can do innerHTML.toString().toLowerCase() |
| Easiest would be to try 'var inner = new String($('cart').innerHTML);' |
| Ikopar, thanks, I'll try that |
| Ikopar, Ooo, that's a good idea |
| Error: $("cart").innerHTML.toString.toLowerCase has no properties |
| You need the () |
| Do I need Oh, thanks |
| $("cart").innerHTML = $cart("innerHTML").toString().toLowerCase(); |
| That worked, thanks man |