|
JSLint gives me a "Bad escapement" message on the following line, I'm guessing its something with that which follows the backslash but I suck at regex and can't get it cleaned up, halp:code:
|
# ¿ Apr 9, 2009 20:37 |
|
|
# ¿ May 4, 2024 05:38 |
|
sonic bed head posted:Why on earth are you using the RegExp constructor? Why not... Umm, I don't know, but I'm doing it your way now.
|
# ¿ Apr 9, 2009 20:43 |
|
Divinorum posted:do my homework for me Start by resolving your javascript errors. For one, I don't think document.LottoFrm.txtcount will work, you can give the text box an id and call document.getElementById('txtcount') instead. (The latest version of firefox requires you to go to Tools>ErrorConsole to see the errors, not sure about IE et al) Then once the syntax is correct start looking at your logic. It may be doing what you want already, I just glanced pretty quickly, but from what you're describing you want to be reading the count value and displaying it in the txtcount field after you've processed the main loop, instead of reading it in from the txtcount field before the loop (should there even be anything in that field at this point? seems like this is where your answer goes, not where you get user input) Kekekela fucked around with this message at 18:10 on Apr 22, 2009 |
# ¿ Apr 22, 2009 17:47 |
|
I haven't used any of the IE tools since IE Dev Toolbar or whatever for IE7, which I thought was really buggy compared to Firebug. Is there something better out there for IE now?
|
# ¿ Apr 22, 2009 20:46 |
|
Just curious: Will it work if you change this: code:
code:
|
# ¿ Apr 26, 2009 14:55 |
|
Sointenly posted:
If you're asking how to get both javascript functions to fire from your button input, you can: Add another statement to your onclick like: code:
Or wrap them in one function that calls both: code:
code:
Kekekela fucked around with this message at 09:12 on Oct 12, 2009 |
# ¿ Oct 12, 2009 08:38 |
|
Sointenly posted:acht! can you spot where I'm loving up here 1. All that stuff under the "checkemail();" line should be in a function called checkemail. 2. Modify the checkInput function to return a boolean indicating success/failure. 3. Check the return values of checkInput and checkemail from within the wrapper function to determine whether or not to display the success message. 4. (optional for consistency) You don't really need to pass the name of the username textbox in as a parameter, you can just hardcode it like you're doing in the email example.
|
# ¿ Oct 13, 2009 02:19 |
|
Sointenly posted:Just for clarification sake... When the submit button is clicked it will trigger the form's onsubmit, which is where he's calling your validate function: form id="myform" onsubmit="return validateForm();" method="POST" action="submitpage.html"
|
# ¿ Oct 13, 2009 03:59 |
|
Elected by Dogs posted:any ideas what's wrong? Wrap the javascript in a document ready handler as shown below to get the click function working. Also the test condition in your if-statement evaluates to false so you wouldn't get to the confirm dialog anyway, I added an alert in an else-block that illustrates this. There might be some other problems (I didn't really get into the logic of what you were trying to do, just why the click function wasn't firing, and then why the confirm statement wasn't being reached once the click function was fixed). This should get you going: code:
Kekekela fucked around with this message at 22:29 on Dec 3, 2009 |
# ¿ Dec 3, 2009 21:43 |
|
usingpond posted:I was considering a new thread for this, but it doesn't really deserve one on second thought. Anyway, I do a bit of Javascript, and I currently use Prototype, with scriptaculous for UI effects. It gained steam with the Alt.Net crowd then with MSFT itself, so its being used a lot more in the corporate world (from what I can see, anyway). I was using Prototype when we decided to switch over to jQuery at the shop where I was working once we saw the way the wind was blowing as far as the Alt.Net'er/MVP crowd loving on jQuery over Prototype, and I do like it a lot better now. That said, the only thing I've used Prototype for since then was for a UI widgit that Scriptaculous did better (in my opinion) than jQuery UI.
|
# ¿ Dec 31, 2009 09:04 |
|
dancavallaro posted:What is an example of a use case where it makes sense to use == over ===? parseInt(x) == parseInt(y) e: alternatively... aFunctionReturningAnIntThatDoesntGiveAFuckAboutBases(x) == aFunctionReturningAnIntThatDoesntGiveAFuckAboutBases(y) Kekekela fucked around with this message at 15:49 on Sep 2, 2010 |
# ¿ Sep 1, 2010 18:39 |
|
Munkeymon posted:Do you find that it matters in most situations? Serious question. The most common place where it matters is (as with most everything) when dealing with 0's, empty strings etc since you'll get some things you might not be expecting, like 0 == '' being true.
|
# ¿ Sep 1, 2010 20:11 |
|
Tivac posted:You probably want bases on those calls to parseInt or else if the input is something like "08" you aren't going to get the answer you want. Thanks for this. Just substitute in "function call returning a specific type == same function called with different params" if you're really not understanding what that post was trying to convey. (I realize you probably couldn't and won't be bothered to read what I was replying to, but just in case) Kekekela fucked around with this message at 15:48 on Sep 2, 2010 |
# ¿ Sep 2, 2010 15:33 |
|
Canine Blues Arooo posted:I'm pretty bad with the Javascripts. I want to a different image to load depending on the URL of the site. I've attempted this: I think location.href also returns the http:// prefix which could be causing your comparison to fail.
|
# ¿ Dec 20, 2011 21:53 |
|
Poop Delicatessen posted:Boise is just raping ASU. That's pretty interesting but not really javascript related.
|
# ¿ Dec 23, 2011 04:43 |
|
ashgromnies posted:Would anyone be interested in learning more about this?
|
# ¿ Jan 8, 2012 21:13 |
|
DimpledChad posted:The black box is pretty simple, at least the basic architecture. If you want to understand how the JS event loop works internally, this presentation is a great introduction:
|
# ¿ Apr 14, 2015 14:48 |
|
Boz0r posted:If I have a type inheriting from another type, how do I find out which properties are defined on the parent or the child? If I'm understanding you correctly you want hasOwnProperty. ...or If you don't care whether its inherited or not you can just do if ('someprop' in myObj)
|
# ¿ May 24, 2015 13:38 |
|
Boz0r posted:I'll check it out. I'm looking to get a list of the properties defined in the parent, and a list of the properties defined in the child. Oh sorry, try Object.keys
|
# ¿ May 24, 2015 14:32 |
|
Subjunctive posted:AFAIK he's still active. I'm actually just listening to an Eich presentation where he says that Crockford doesn't attend anymore. https://www.youtube.com/watch?v=u56b_HUj47E e: for some reason the time cue got messed up when SA converted the video link, it should be at 12m30s for the relevant bits
|
# ¿ May 26, 2015 12:14 |
|
v1nce posted:regex101 is a great tool for explaining what's going on. I suggest you combine it with the above tutorials:
|
# ¿ Jun 5, 2015 11:19 |
|
Thermopyle posted:What's the plan on module support in the browser? How's that going to work? This is the eventual syntax (sorry if that's not what you were asking) : http://www.2ality.com/2014/09/es6-modules-final.html e: oh you wanted browser implementation details, um, uh, erm... Kekekela fucked around with this message at 10:39 on Jul 24, 2015 |
# ¿ Jul 23, 2015 20:19 |
|
disclaimer: I'm a novice with promises but I work in some pretty promise heavy code-bases so it was vital to my sanity that I comprehend them somewhatKnifegrab posted:It seems like the pg's query function is blocking, so can I just not use promises with it? When you say its blocking, do you mean from a logical standpoint the program can't continue until the query is complete? If so then then I think the "You're Missing the Point of Promises" section here will probably be useful. I know you said you've read all the resources, but this may be extremely on point I think. It really helped me reframe promises in my head as "callback aggregator thinger..." to providing the correspondence between synch and async functions he describes in that gist: Domenic Denicola posted:The thing is, promises are not about callback aggregation. That's a simple utility. Promises are about something much deeper, namely providing a direct correspondence between synchronous functions and asynchronous functions.
|
# ¿ Aug 8, 2015 11:47 |
|
Knifegrab posted:What the gently caress is a virtualized DOM and how is it different from a normal DOM? Its like a copy of the DOM that react maintains internally. When you are rendering components etc the operations are taking place on the virtualized DOM, which can then be compared to the real DOM so that only the necessary changes need to be applied. Also as far as the other stuff, I'm liking babel since it lets me get used to new ES2015 module syntax etc. I've been using this boilerplate for my current meanderings: https://github.com/vasanthk/react-es6-webpack-boilerplate
|
# ¿ Aug 22, 2015 01:54 |
|
Some of the poo poo in that waterline article, dear god.
|
# ¿ Sep 8, 2015 19:30 |
|
"and I'm pretty sure most of us still have jobs paying us to work with it that we go along with" Oddly enough I write C#/ASP.NET stuff for a living and honestly just find the whole node.js ecosystem fun to gently caress around with (especially since all I really need is sublime and a command prompt), in addition to getting warm and fuzzies from contributing to open source projects which its kind of enabled for me. I'm also pretty sure its contributed in weird and good ways to the msft stuff I write.
|
# ¿ Sep 9, 2015 04:10 |
|
code:
https://jsfiddle.net/63ajurLg/3/ code:
I'm guessing you realize this, but with your current html, "workTime" will need to be parsed into minutes and seconds so that their respective span's text can be set separately. (trying to just set the parent "clock" div html is going to replace everything it contains as you already ran into, if that's what you want to do you could do away with the spans https://jsfiddle.net/v5qujmwd/2/) Kekekela fucked around with this message at 21:52 on Dec 20, 2015 |
# ¿ Dec 20, 2015 11:20 |
|
Raskolnikov2089 posted:Help, React is trying to kill me Could swig be using a different version of react? react-id's got axed recently is one reason I'm thinking that
|
# ¿ Mar 8, 2016 11:11 |
|
stoops posted:i have this code that gives me the month of a date Git rid of the leading 0 on the day.
|
# ¿ Apr 13, 2016 02:53 |
|
Strong Sauce posted:https://twitter.com/etiene_d/status/745218992319639552
|
# ¿ Jun 23, 2016 10:05 |
|
BobFossil posted:I just want to show the current date minus 12 months and 3 months then strip out the time and GMT info - why are the dates wrong? You want getDate (which returns the day part of the date) not getDay, which returns 1 for Monday, 2 for Tuesday, 3 for Wednesday etc
|
# ¿ Sep 28, 2016 22:11 |
|
I use Powershell/Sublime for npm projects on Windows. I used to use an Ubuntu vm or try to do more stuff on my mac instead but no longer feel the need. The only place I've run into problems is weird file locking stuff when I used to run multiple Powershell windows with webpack-dev-server, but restricting myself to a single console window fixed that. I guess that does kind of suck, but the server is WebAPI so having Visual Studio running that in the same environment is pretty convenient.
|
# ¿ Oct 10, 2016 00:00 |
|
I think he means because you use npm by default to install Yarn.
|
# ¿ Oct 11, 2016 22:03 |
|
Strong Sauce posted:npm install is not the "default" it's literally just the easiest way if you're already using npm. Ok thank you for clarifying. I was just thinking of what you would call the way everyone's going to do it, what's the word for that? Kekekela fucked around with this message at 03:23 on Oct 12, 2016 |
# ¿ Oct 12, 2016 03:21 |
|
e: killing my own derail
Kekekela fucked around with this message at 19:33 on Oct 12, 2016 |
# ¿ Oct 12, 2016 18:35 |
|
Knifegrab posted:I have some NPM packages that I forgot to init and do proper saving etc on. After I had a bunch of node_modules I did an npm init which threw everythign into the dependency category. Unfortunately a lot of these are devDependencies. Is there a command to change a dependency to be a devDependency, google has failed me. I'd edit package.json to get your dependencies correct then delete node_modules and do a fresh npm install.
|
# ¿ Jan 16, 2017 19:36 |
|
Curly braces mean you're importing a non-default member. export default butts import butts export butts export dongs import {butts, dongs}
|
# ¿ Mar 21, 2017 22:21 |
|
Newf posted:Another ES6 / React question. spread gives you immutability which can be an important consideration. Its what you'll find being used in reducers in redux for example (this is actually where I started using them because it was necessary which lead to me using them all over the place because it was convenient)
|
# ¿ Mar 25, 2017 10:38 |
|
Newf posted:That said, I'm still lost as to how to debug this ES6 code, since all of it ends up bundled If you're in chrome dev tools in the sources tab go down to the bottom of the treeview and select your source files from the webpack node. Might need to enable sourcemaps in your webpack config for that to work. And webpack-dev-server is doing the hot reloading, not babel.
|
# ¿ Mar 27, 2017 22:29 |
|
|
# ¿ May 4, 2024 05:38 |
|
Sab669 posted:
I'm guessing his thought was that if there was an error rendering someVar, you'd be left with a blank div instead of the previous content.
|
# ¿ Apr 17, 2017 13:31 |