|
Weird Uncle Dave posted:I'm relatively new to JavaScript generally (I grew up doing everything server-side), and yesterday was my first exposure ever to jQuery. That said, I don't see why this is "better" than my approach. Unobtrusive javascript is a cleaner approach. The syntax he's using is a jQuery upgrade to the window.onload method used in the wiki article samples. Kekekela fucked around with this message at Jun 13, 2009 around 04:29 |
| # ¿ Jun 13, 2009 04:19 |
|
|
| # ¿ May 20, 2013 04:05 |
|
Metonymy posted:Lets say I'm using a jQuery AJAX call to pull some JSON and then populate a div with that information using a grim text concatenation ("<div class='gubbawumps'>...") and then a jQuery append(). It seems like the right way to do this is probably with a jQuery.load() and have a page get rendered that contains the HTML I want, rather than trying to generate one in text in javascript. Any thoughts? It's a relatively sizable chunk of content with a lot of markup. While I see the allure of doing the whole page at once I've generally found it more practical to go with an approach more like what you're talking about with the append() statements. Its definitely something where I feel like my approach is a work in progress though, not claiming to have the "right" way.
|
| # ¿ Jul 17, 2009 23:10 |
|
edit: never mind, gratuitous
Kekekela fucked around with this message at Jul 21, 2009 around 22:07 |
| # ¿ Jul 21, 2009 22:05 |
|
Mercator posted:You don't have javascript? Feh, you don't get to delete anything. I'm saving up to buy it when it goes on sale.
|
| # ¿ Jul 22, 2009 16:41 |
|
Lumpy posted:Remember back when this was the jQuery thread? Php megathread, for those that weren't aware. edited to provide link without faggoty snarky comment Kekekela fucked around with this message at Aug 18, 2009 around 20:28 |
| # ¿ Aug 18, 2009 19:46 |
|
Hanpan posted:I am trying to create a really simple image toggle for a "open/close" icon, and after a google it seems you can attach functions to the toggle method. I can't seem to get it to work however: You need to put it inside the ready handler, like this... code:Kekekela fucked around with this message at Sep 20, 2009 around 14:20 |
| # ¿ Sep 20, 2009 14:15 |
|
On the validator subject, I've been meaning to ask for a slicker way to actually validate a date (since the built in "date" validator is worthless and allows poo poo like 86/87/9999) than what I cobbled together:code:
|
| # ¿ Oct 21, 2010 16:49 |
|
MEAT TREAT posted:Remember that date validation is Locale specific, but there are a lot of good jquery date validator plugins. All of the dates have to be mm/dd/yyyy, its a preexisting site that handles prescriptions for customers in the US. It already uses jQuery validator so I wanted to just be able to add a custom validation method to that instead of using a separate plugin.
|
| # ¿ Oct 21, 2010 17:02 |
|
|
| # ¿ May 20, 2013 04:05 |
|
Lumpy posted:When I don't roll my own, I use this: Also what I use. Provides good functionality "out of the box" and very easy to customize with your own rules.
|
| # ¿ Feb 5, 2011 19:19 |




