|
necrotic posted:Which ie? Does ie even support inline functions like that map call? IE 11
|
# ? Jul 20, 2016 16:39 |
|
|
# ? Jun 5, 2024 09:30 |
|
stoops posted:I have this jqplot graph script I'm using that works on chrome, but doesnt on IE. If you aren't using Babel or something else, that won't work in any browser except the most recent Crome. ES6 is not usable as-is right now. Transpile it or use ES5 code. EDIT: some compatibility charts! https://kangax.github.io/compat-table/es6/ Lumpy fucked around with this message at 17:05 on Jul 20, 2016 |
# ? Jul 20, 2016 17:03 |
|
stoops posted:I have this jqplot graph script I'm using that works on chrome, but doesnt on IE. You can also simply convert that lambda to code:
|
# ? Jul 20, 2016 17:58 |
|
I'll check out Babel, thanks for the recommendation.Skandranon posted:You can also simply convert that lambda to Thanks, that worked!
|
# ? Jul 20, 2016 20:37 |
|
When would you want to use reduceRight() instead of reduce()? I can understand something like foldl vs. foldr in Haskell, where you could have an infinite list, but I didn't think that could really happen in JS, and otherwise it seems like they'd give you the same result (outside of doing something messy with implicit conversion).
|
# ? Jul 26, 2016 18:32 |
|
Depressing Box posted:When would you want to use reduceRight() instead of reduce()? If you're doing a sum sure, but other mathematical operations would give you different values. Or as you mentioned, gross implicit conversions. Also, javascript has generators now for infinite lists. Though I'm not sure if you can use reduceRight on those? I haven't really touched generators. necrotic fucked around with this message at 21:36 on Jul 26, 2016 |
# ? Jul 26, 2016 21:33 |
|
Depressing Box posted:When would you want to use reduceRight() instead of reduce()? Having both at hand is very useful when performing functional composition to maintain the relationship between the conceptual model and the sequence of individual function steps e: I'm phone posting so no example at hand but looking up how up how Redux middleware works behind the scenes may be enlightening. ynohtna fucked around with this message at 21:56 on Jul 26, 2016 |
# ? Jul 26, 2016 21:48 |
|
necrotic posted:If you're doing a sum sure, but other mathematical operations would give you different values. Or as you mentioned, gross implicit conversions. Wow, somehow I didn't even consider non-sum operations. That makes sense. With generators, at least, the returned iterator object doesn't implement map/reduce/etc., so you'd need to write your own, probably wrapping for...of or something. ynohtna posted:Having both at hand is very useful when performing functional composition to maintain the relationship between the conceptual model and the sequence of individual function steps This also makes a lot of sense. I guess it's a useful stand-in for a formal compose function (and literally the innards of Redux's compose() function, as you pointed out). Thanks for the explanations!
|
# ? Jul 26, 2016 22:52 |
When you ignore a poster on SA, their posts still appear as "Jerk detected! This user is on your ignore list, click to view post anyway" I just wanted to hide the post altogether. Then I thought it would be nice to obscure any posts quoting them; but I can't seem to figure out how to get this arrow image centered with the text: That's probably more of an HTML/CSS question but I'm also hoping I can get a couple optimizations on the javascript and call it v0.1.0 Something-Awful-True-Ignore.user.js
|
|
# ? Jul 28, 2016 03:37 |
|
Chunjee posted:When you ignore a poster on SA, their posts still appear as "Jerk detected! This user is on your ignore list, click to view post anyway" Throw some flexbox on the DIV that holds the text / graphic: code:
|
# ? Jul 28, 2016 16:39 |
Thanks. I went through a list of "how to center stuff" and gave up right on the flexbox way because I had mistakenly assumed it was somekind of external framework.
|
|
# ? Jul 28, 2016 17:19 |
|
Chunjee posted:Thanks. I went through a list of "how to center stuff" and gave up right on the flexbox way because I had mistakenly assumed it was somekind of external framework. Here's a good guide to it if you want to learn yourself: https://css-tricks.com/snippets/css/a-guide-to-flexbox/ It's a pretty amazing thing, and now we can actually use it!
|
# ? Jul 28, 2016 17:31 |
|
OK, I am a complete noob to all of this so bear with me. I am building a chart using chart.js and this code which enables you to draw an arbitrary line on the chart: code:
|
# ? Jul 31, 2016 21:33 |
|
I don't think it's just you; I've seen complaints about pointRadius not cooperating, so you might want to try radius instead. If the code is crashing on you because you've put in the other parameters, be certain that you are ending lines with a comma if another argument follows. Also, while I realize you c/p'd the charts code, be sure to stay consistent with single/double quotes usage. code:
|
# ? Jul 31, 2016 21:52 |
|
Bill NYSE posted:Here is an update showing the other options you wanted to have presented, but they do not seem to actually make a difference in how the chart is displayed: https://jsfiddle.net/dbyze2ga/326/ I am only doing this to get around Squarespace's deficient chart block. I wish there was a WYSIWYG JS solution for this.
|
# ? Jul 31, 2016 22:04 |
|
KOTEX GOD OF BLOOD posted:This is my problem!! But, it works fine without the vertical line code. So it seems like something about the way that is done is loving this up. Unfortunately I don't know Javascript. I am a huge proponent of google's charts API: https://developers.google.com/chart/ It comes with nice documentation and they set good standards to follow for future development. edit: go here for the Quick Start to get the basics down with copy/paste: https://developers.google.com/chart/interactive/docs/quick_start
|
# ? Jul 31, 2016 22:18 |
|
^I love the clarity of the documentation here but it doesn't seem to have an option for dividing up the chart between two areas, which is what I'm trying to accomplish. e: It would be especially great if I could have each area be a different color. Trying to put a before/after in stark contrast. ee: OK, I figured out how to do this. You can use "scope" to de-emphasize a region. Then you can draw a vertical line using annotations. Google Charts is definitely the poo poo, although it's not as pretty as chart.js. KOTEX GOD OF BLOOD fucked around with this message at 02:22 on Aug 1, 2016 |
# ? Jul 31, 2016 23:04 |
|
Pretty can come later when you learn a little more CSS, and you can throw it into the javascript to enhance the chart's appearance. I'm glad it worked out for you!
|
# ? Aug 1, 2016 02:33 |
|
Anyone familiar with or have some great links for creating JS bindings to some C++ libraries http://swig.org seems to be a good start, but I'm wondering if there are some more newbie friendly materials than their Docs. Or alternatives.
|
# ? Aug 4, 2016 00:21 |
|
Not sure if this is the best place, or the web front end thread, but whatever. I'm working on a personal project, and I have this really lightweight data layer object. If I copy-paste the code into a jsfiddle, it works as expected. In my project I get code:
Things that may be relevant:
any ideas?
|
# ? Aug 8, 2016 06:12 |
|
The Fool posted:Not sure if this is the best place, or the web front end thread, but whatever. Shot in the dark here, but how is layer.register being called? Are you importing layer.js as "layer" into your ComponentWillMount, then calling register? However it is being imported, it is not actually running through your var layer={} line, or the layer you are calling is not the global layer you think it is. Change the name of one of them and this should become more obvious. My guess is you do not have layer.js set up as a proper CommonJS module, and are not exporting your layer object, so when you import it, you are getting something very different from what you are expecting.
|
# ? Aug 8, 2016 06:40 |
|
Skandranon posted:Shot in the dark here, but how is layer.register being called? Are you importing layer.js as "layer" into your ComponentWillMount, then calling register? However it is being imported, it is not actually running through your var layer={} line, or the layer you are calling is not the global layer you think it is. Change the name of one of them and this should become more obvious. My guess is you do not have layer.js set up as a proper CommonJS module, and are not exporting your layer object, so when you import it, you are getting something very different from what you are expecting. So I came here to edit my post saying that I had figured it out. It was literally the difference between module.export and module.exports.
|
# ? Aug 8, 2016 06:50 |
|
Is there a jquery event or some method, that's the opposite of .one()? I have a function that loads content, then tiles them, masonry style. I would rather not reload the content of course. I suppose I could just add a counter or something but I'm open to something a bit more elegant. Boosh! fucked around with this message at 14:47 on Aug 8, 2016 |
# ? Aug 8, 2016 14:41 |
|
Boosh! posted:Is there a jquery event or some method, that's the opposite of .one()? I have a function that loads content, then tiles them, masonry style. I would rather not reload the content of course. Not sure what you're asking exactly, but if you mean you want it to fire every time except the first? if so, you could just set your event .on() inside the .one callback.
|
# ? Aug 8, 2016 14:48 |
|
Boosh! posted:Is there a jquery event or some method, that's the opposite of .one()? I have a function that loads content, then tiles them, masonry style. I would rather not reload the content of course. Can you use promises? Use of .then() solved a lot of my jQuery timing headaches.
|
# ? Aug 8, 2016 14:48 |
|
Ahhh simple enough, thanks fellas
|
# ? Aug 8, 2016 15:06 |
|
Is there a JQuery plugin that comes with cheap ajax capabilities for form submissions? What I really want to do is have a form that traditionally works without javascript and reloads the entire page, but if they have javascript I would love to just stick an id (or several) in a data attribute on the form that tells the plugin what content is going to be updated on the submit, and then basically it could just parse those ids, parse the html content out of the result, and update the sections of the page with results. The server is still going to do all the extra work of returning the entire page but to be honest the performance of that is fine.
|
# ? Aug 8, 2016 21:55 |
|
FateFree posted:Is there a JQuery plugin that comes with cheap ajax capabilities for form submissions? What I really want to do is have a form that traditionally works without javascript and reloads the entire page, but if they have javascript I would love to just stick an id (or several) in a data attribute on the form that tells the plugin what content is going to be updated on the submit, and then basically it could just parse those ids, parse the html content out of the result, and update the sections of the page with results. The server is still going to do all the extra work of returning the entire page but to be honest the performance of that is fine. Sounds a bit like PJAX forms, http://stackoverflow.com/questions/30766466/submitting-form-with-pjax (I haven't used it myself)
|
# ? Aug 8, 2016 22:04 |
|
N.Z.'s Champion posted:Sounds a bit like PJAX forms, Wow how about that. Thanks! I figured the use case might be common enough for other people.. Its like ajax for lazy folks.
|
# ? Aug 9, 2016 00:58 |
|
If I was going to build a Trello-like card interface, should I just use jquery UI or are there good alternatives? Is something similar built into other popular frameworks? Will I kill myself trying to build a 2D hit detection engine from scratch?
|
# ? Aug 12, 2016 00:29 |
|
Bob Morales posted:If I was going to build a Trello-like card interface, should I just use jquery UI or are there good alternatives? Is something similar built into other popular frameworks? Will I kill myself trying to build a 2D hit detection engine from scratch? You don't need a hit detection engine, just go through this tutorial: http://www.html5rocks.com/en/tutorials/dnd/basics/ A good rule of thumb is when you find yourself asking "do I need jQuery UI" the answer is "nope".
|
# ? Aug 12, 2016 02:31 |
|
Anybody have experience with DraftJS? I've got a draftJS editor that uses decorators for some custom block controls that render their react component into the editor just fine, but I'm stuck trying to take the saved state of the editor and render it elsewhere, outside of the editor, as React components. Conceptually trying to use DraftJS as a CMS wysiwyg that saves the state of the editor's content to a DB and then attempts to use that saved state and render it to the frontend. Right now I'm using https://github.com/sstur/draft-js-export-html to convert the raw state to dom elements as a string and then dangerouslySetInnerHTML to write that stringified output to the dom. Is anyone familiar with a way to, instead of using dangerouslySetInnerHTML, map entities to React components and then render those components?
|
# ? Aug 12, 2016 17:22 |
|
I've been trying out different SO solutions and trying to teach myself this stuff along the way, but this seems like it should work and I think I'm just missing something trivial? I'm selling a stupid knife on a single page using a paypal button to handle the commerce stuff. I want to run my own php script to grab form data and send it off to mysql database before the buttons posts so I'm attempting to use ajax as a handler. My Ajax looks like this code:
code:
|
# ? Aug 15, 2016 03:21 |
|
I'm pretty sure you will need a preventDefault() to stop the form from immediately submitting, then rolling through that action in your javascript -- instead of the inline form action you have in your HTML.
|
# ? Aug 15, 2016 03:34 |
|
I tried throwing code:
|
# ? Aug 15, 2016 03:43 |
|
Portland Sucks posted:I tried throwing What about something like: code:
|
# ? Aug 15, 2016 03:50 |
|
Nah that just leaves me with a nonfunctional button. What can I use to figure out whether or not its even getting inside the ajaxRequest() function?
|
# ? Aug 15, 2016 04:04 |
Portland Sucks posted:Nah that just leaves me with a nonfunctional button. What can I use to figure out whether or not its even getting inside the ajaxRequest() function? code:
|
|
# ? Aug 15, 2016 04:07 |
|
Portland Sucks posted:I tried throwing
|
# ? Aug 15, 2016 05:15 |
|
|
# ? Jun 5, 2024 09:30 |
|
Oh yeah, sorry. If you're going to call event.preventDefault() then your code will need to define that variable call within the function:code:
|
# ? Aug 15, 2016 14:09 |