Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
MasterSlowPoke
Oct 9, 2005

Our courage will pull us through
Placeholders shouldn't replace labels. Once the form is filled out, no one will remember why they put what they did. The placeholder should be an example of what you want them to put.

Adbot
ADBOT LOVES YOU

bpower
Feb 19, 2011
Hi guys,

I'm new to web dev but have many years experience in other areas.

I just joined a new company and want to implement some simple logging in their c#/asp.net webforms site. (They've none whatsoever)

I just want a simple class like this.

Props:
EnableLoggingForCurrentUser(bool)

Methods:
LogStuff (Stuff)


We can set EnableLoggingForCurrentUser from anywhere.LogStuff is in few key places (error class,db class ).

The other guy with experience in web dev wants to create a static class guys with just LogStuff (Stuff) and store EnableLoggingForCurrentUser in session state, which will be read from within LogStuff. His approach seems easy to implement but wrong to me, but I'm not sure how to implement my idea. Where should I create my logging instance that allows any page to set EnableLoggingForCurrentUser?

Pollyanna
Mar 5, 2005

Milk's on them.


I'm trying to make a to-do list with React, and I've ALMOST got some basic functionality down. Unfortunately, I'm kind of stuck on making it React to checkbox changes. Here's what I got so far - you can't toggle the checkboxes at all.

I'm not sure how you would change the data on the model/todoItem instance from clicking the checkbox. :confused: I thought the view was just supposed to change how it looks, not the data? Shouldn't the state be entirely dependent on the state of the data in the associated model? How come the checkbox is in charge of setting completed: false/true on the TodoItem?

I might be very, very confused :(

My Rhythmic Crotch
Jan 13, 2011

Is that link correct? I'm not seeing anything show up in the results at all.

Pollyanna
Mar 5, 2005

Milk's on them.


My Rhythmic Crotch posted:

Is that link correct? I'm not seeing anything show up in the results at all.

Works perfectly well on my end. The React and JSX libraries are included under 'external components' IIRC. Everything should be there...

Kobayashi
Aug 13, 2004

by Nyc_Tattoo

Pollyanna posted:

I'm trying to make a to-do list with React, and I've ALMOST got some basic functionality down. Unfortunately, I'm kind of stuck on making it React to checkbox changes. Here's what I got so far - you can't toggle the checkboxes at all.

http://todomvc.com/examples/react/

Disappointing Pie
Feb 7, 2006
Words cannot describe what a disaster the pie was.
Beginner HTML/CSS guy here. Played a lot mastered nothing. Is team Treehouse worth it?

yoyomama
Dec 28, 2008

Disappointing Pie posted:

Beginner HTML/CSS guy here. Played a lot mastered nothing. Is team Treehouse worth it?

I'm in the same boat, and I've found Code Academy to be really good, and it's free. I feel like there are so many free resources out there, that I haven't seen the need yet to pay to learn HTML/CSS, unless it's an actual local class where I also get the benefit of meeting people (and it's not a monthly fee).

I guess it all depends on your learning style, but I've found paying for local classes and workshops and using free online resources to be the best way to get the most out of any money I'm investing into learning web dev/design.

Raskolnikov2089
Nov 3, 2006

Schizzy to the matic

Disappointing Pie posted:

Beginner HTML/CSS guy here. Played a lot mastered nothing. Is team Treehouse worth it?

About a year into the same quest, and only just beginning to get serious about it (starting to understand JavaScript feels like a superpower).

Treehouse gives you practical knowledge where I think codecademy only shows you concepts. I went through the codecademy JavaScript track twice, and at the end I still felt incapable of doing anything beyond declaring variables. I signed up for Treehouse and that helped me put some of the concepts into practice.

If you've gone through the codecademy html/css tracks, you should build something first. It will cement and increase your knowledge more than anything else.

Raskolnikov2089 fucked around with this message at 03:16 on Nov 3, 2014

lunar detritus
May 6, 2009


I haven't seen Treehouse's content but most of those interactive web courses are comparable to those lovely LEGO sets that came with instructions and no way to make anything else due to the lack of variety in the blocks.

In the end the only way to really learn a language is to choose a simple project and start hacking at it.

EDIT: And avoid Bootstrap like the plague if you want to learn HTML instead of, you know, Bootstrap.

yoyomama
Dec 28, 2008

gmq posted:


In the end the only way to really learn a language is to choose a simple project and start hacking at it.


Gotta agree with this sentiment. I've been learning with online and in-person classes, but it all really clicks now once I've been using it to work on my own website. Whenever I'm going over any new concepts, I always make sure to also think about how I'd apply it, add to my notes for my own project, and/or make changes to my html and css to fix or add new features as I'm learning about them.

Sereri
Sep 30, 2008

awwwrigami

Is there a good Pull-to-refresh library that I can use at the bottom of the page of my webapp?

None of the (good) native implementations see pulling from the bottom as a use case, so I thought maybe between the thousands of JS libs there would be one I could use.

ambushsabre
Sep 1, 2009

It's...it's not shutting down!

Sereri posted:

Is there a good Pull-to-refresh library that I can use at the bottom of the page of my webapp?

None of the (good) native implementations see pulling from the bottom as a use case, so I thought maybe between the thousands of JS libs there would be one I could use.

I think you might have to write your own here, but on the upside if you make it into a library that's totally something I would use.

Raskolnikov2089
Nov 3, 2006

Schizzy to the matic

gmq posted:

I haven't seen Treehouse's content but most of those interactive web courses are comparable to those lovely LEGO sets that came with instructions and no way to make anything else due to the lack of variety in the blocks.

In the end the only way to really learn a language is to choose a simple project and start hacking at it.


It's good as a jumping off point. Codecademy is great at getting the basic concepts down, but last time I went through the JavaScript track, they completely ignored the basics that a completely tyro programmer just doesn't know.

Script tags for instance. The JavaScript track didn't even touch on them. Thankfully through some googling I was finally able to link my html page to my first javascript file, but it took an hour or two of frustration.

The thing I liked about treehouse is, they give you fully formed websites in their example files that you work from. It's well and good to learn .pop() and .push(), but frankly I didn't know fully connect why I would need array traversal like that until treehouse walked me through form validation.

In the end though, what I learned from treehouse is absolutely 1000% dwarfed by the amount I learned from hacking away at my own projects. But if all you have is a bunch of concepts that you can't figure out how to apply to the real world, treehouse offers a lot of "huh, so that's why it's useful" moments. Worth it for a month I'd say.

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!

When I first decided to teach myself JavaScript years back, I read two entire books cover to cover, thoroughly understanding at the time everything I read. Immediately after having "learned" the language, I moved on to something else, never actually applying my knowledge to a real life application. Fast forward to six months later when I actually had to write some JS, my mind was blank and I found myself Googling "javascript how to create an array" and other incredibly basic stuff that I ostensibly "learned". For me, there simply is no learning without applying my knowledge to a real project.

gariig
Dec 31, 2004
Beaten into submission by my fiance
Pillbug
I need some help. We have a simple single-page application using SammyJs. We just went through an internal deployment. One of our users had the web app open under version previous while we did the upgrade. One of the views had some new CSS classes added to it. When the user with Version A loaded went to the new view they got the update HTML with the new CSS class but not the updated CSS style sheet.

What is the best way to fix this? Right now we are think of storing the version of our backend, polling for that, and if it changes ask the user to refresh.

kedo
Nov 27, 2007

gariig posted:

I need some help. We have a simple single-page application using SammyJs. We just went through an internal deployment. One of our users had the web app open under version previous while we did the upgrade. One of the views had some new CSS classes added to it. When the user with Version A loaded went to the new view they got the update HTML with the new CSS class but not the updated CSS style sheet.

What is the best way to fix this? Right now we are think of storing the version of our backend, polling for that, and if it changes ask the user to refresh.

code:
<link rel="stylesheet" href="styles.css?v=2"/>
Adding a version number like that will make the browser download it as opposed to using a cached version. Probably the easiest way I know of without straight up preventing caching.

MonkeyMaker
May 22, 2006

What's your poison, sir?

Disappointing Pie posted:

Beginner HTML/CSS guy here. Played a lot mastered nothing. Is team Treehouse worth it?

I'm the Python teacher at Treehouse. Our HTML/CSS/JavaScript areas are definitely the most filled out of any that we offer and they're definitely great for beginners. We don't use any sort of drag-and-drop blockly/scratch-like interface and we give you a pretty full-featured web-based text editor that you can use along with our courses or for building your own stuff. PM me and I can give you a coupon for a free month's trial.

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

I'm not entirely caught up on new web technologies (I stopped paying attention after learning jQuery/JSON), but the way I learned JS et al was find something cool on the internet, save a copy to local, get it working, and then totally tear it apart. Change colors, hover states, event wireups, whatever. Then after I was relatively solid on that, try to make my own version of something similar. Back when I was learning JS was kind of folded into this ambiguous mess called 'DHTML'; I think I started with someone's JS version of Outlook Express and ended up with a bad version of Cribbage.

gariig
Dec 31, 2004
Beaten into submission by my fiance
Pillbug

kedo posted:

code:
<link rel="stylesheet" href="styles.css?v=2"/>
Adding a version number like that will make the browser download it as opposed to using a cached version. Probably the easiest way I know of without straight up preventing caching.

We are already doing versioning. However, we only link to our stylesheets on the index.html for our website. It's never loaded on any of our views. So you get styles.css?v=1 when you come to the website but the browser never sees the updated index.html what has

code:
<link rel="stylesheet" href="styles.css?v=3"/>
Real solution is don't do a single page application but that's not going to work here.

revmoo
May 25, 2006

#basta
I had a colleague come to me with an issue; apparently Windows and windows only causes timeouts on REALLY LONG ajax calls, regardless of browser. This causes issues for us as we have reports that can take several minutes to run.

Are there any easy fixes for this, or do I just need to add in some sort of background polling in the browser to check when the report is done? (Really don't want to do this, it would involve a shitton of re-architecting)

kedo
Nov 27, 2007

gariig posted:

We are already doing versioning. However, we only link to our stylesheets on the index.html for our website. It's never loaded on any of our views. So you get styles.css?v=1 when you come to the website but the browser never sees the updated index.html what has

code:
<link rel="stylesheet" href="styles.css?v=3"/>
Real solution is don't do a single page application but that's not going to work here.

Welp. I suppose you could try doing something like this, but I don't have experience with it so :shrug: Other than that, maybe don't allow users to continue using the app unless they "update" (eg. a fancy word for refresh that sounds more app-like)?

revmoo posted:

I had a colleague come to me with an issue; apparently Windows and windows only causes timeouts on REALLY LONG ajax calls, regardless of browser. This causes issues for us as we have reports that can take several minutes to run.

Are there any easy fixes for this, or do I just need to add in some sort of background polling in the browser to check when the report is done? (Really don't want to do this, it would involve a shitton of re-architecting)

This doesn't sound true to me. I've used ajax on dozens of projects and they always test fine on Windows. Have you tried this out yourself? :10bux: says something is wrong with your colleague's computer or network.

revmoo
May 25, 2006

#basta
Haha no I haven't checked and built a test script yet, that's tomorrow. I have to remote in to a windows machine to even do diagnostics for a number of reasons. Just trying to figure out what the low-hanging fruit might be. My colleague seemed to think it was a Windows TCP issue that can be rectified with a registry setting, which is obviously not the fix we can use.

gariig
Dec 31, 2004
Beaten into submission by my fiance
Pillbug

kedo posted:

Welp. I suppose you could try doing something like this, but I don't have experience with it so :shrug: Other than that, maybe don't allow users to continue using the app unless they "update" (eg. a fancy word for refresh that sounds more app-like)?

Just so you can have a good laugh. Someone stuck the CSS right in the HTML instead of adding it to our styles bundle, so it wasn't versioned. That's why it wasn't being updated during our deployment. We are punting on the "update" logic

kedo
Nov 27, 2007

gariig posted:

Just so you can have a good laugh. Someone stuck the CSS right in the HTML instead of adding it to our styles bundle, so it wasn't versioned. That's why it wasn't being updated during our deployment. We are punting on the "update" logic

That's the way it should be done. :colbert:

spacebard
Jan 1, 2007

Football~

kedo posted:

Welp. I suppose you could try doing something like this, but I don't have experience with it so :shrug:

That's what I would do. You could probably bake it into a build process to change the date to build time or change it just prior to committing and tagging?

Chris!
Dec 2, 2004

E
Does Safari handle media queries drastically differently from Chrome, Firefox and IE? I've just tested a site in the Safari desktop browser for the first time (having tested it on those other browsers, plus Safari on my iPhone), and it's ignoring my media queries.

Example media query that's being ignored (this is unminified as I'm working in Sass):

@media only all and (min-width: 79rem) and (max-width: 84rem) {
.navigation-left li
{
padding-right:2.8rem
}
.navigation-right li
{
padding-left:3rem
}

}

Viewport set with <meta name="viewport" content="width=device-width, initial-scale=1.0" />

The site works and responds perfectly in those other browsers... really annoying that it's not working in Safari, I just downloaded Safari 5.1.7 to test after my client reported the issue on his iPad.

Chris! fucked around with this message at 13:19 on Nov 4, 2014

Diabolik900
Mar 28, 2007

Chris! posted:

Does Safari handle media queries drastically differently from Chrome, Firefox and IE? I've just tested a site in the Safari desktop browser for the first time (having tested it on those other browsers, plus Safari on my iPhone), and it's ignoring my media queries.

Example media query that's being ignored (this is unminified as I'm working in Sass):

@media only all and (min-width: 79rem) and (max-width: 84rem) {
.navigation-left li
{
padding-right:2.8rem
}
.navigation-right li
{
padding-left:3rem
}

}

Viewport set with <meta name="viewport" content="width=device-width, initial-scale=1.0" />

The site works and responds perfectly in those other browsers... really annoying that it's not working in Safari, I just downloaded Safari 5.1.7 to test after my client reported the issue on his iPad.

I can't help too much with your specific issue, but I will point out that Safari for Windows has seemingly been abandoned. It hasn't been updated in years. It's not going to reliably give you an accurate representation of how Safari renders your site on OS X or iOS.

revmoo
May 25, 2006

#basta

kedo posted:

Welp. I suppose you could try doing something like this, but I don't have experience with it so :shrug: Other than that, maybe don't allow users to continue using the app unless they "update" (eg. a fancy word for refresh that sounds more app-like)?


This doesn't sound true to me. I've used ajax on dozens of projects and they always test fine on Windows. Have you tried this out yourself? :10bux: says something is wrong with your colleague's computer or network.

You are right. I wrote a quick AJAX test script and was able to hit 8 minutes with no issue on IE. PEBCAK.

Chris!
Dec 2, 2004

E

Diabolik900 posted:

I can't help too much with your specific issue, but I will point out that Safari for Windows has seemingly been abandoned. It hasn't been updated in years. It's not going to reliably give you an accurate representation of how Safari renders your site on OS X or iOS.

Thanks for the reply, I thought it was weird that the latest version I could find from Windows was from 2012. Still strange that my media queries are messed up in it.

Wait, I think it's because I was writing my pre-compiled sass like this:

@media screen and (max-width: rem-calc(1340)) {

}

That's the sass rem-calculation, just tried changing to the pixel equivalents and it's recognizing the media queries. Apparently Safari (this version at least) doesn't like rems in media queries? I can't find any information about it as a recognised issue online, but it's fixed my problem...

jackpot
Aug 31, 2004

First cousin to the Black Rabbit himself. Such was Woundwort's monument...and perhaps it would not have displeased him.<
What have I done that's causing this site I'm working on to not show stylesheet lines in Chrome's dev tools? They display in other sites, just not this one. It's gotta be something simple, I just don't see anything weird that I've done here.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
Do those styles actually come from an external stylesheet or is it a <style> block?

my bony fealty
Oct 1, 2008

caiman posted:

When I first decided to teach myself JavaScript years back, I read two entire books cover to cover, thoroughly understanding at the time everything I read. Immediately after having "learned" the language, I moved on to something else, never actually applying my knowledge to a real life application. Fast forward to six months later when I actually had to write some JS, my mind was blank and I found myself Googling "javascript how to create an array" and other incredibly basic stuff that I ostensibly "learned". For me, there simply is no learning without applying my knowledge to a real project.

I'm kind of in the position you were - I've read a lot about Javascript, feel like I understand the fundamentals, and have built a few simple programs, but I've hit a wall when it comes to improving.

Anyone care to throw out some ideas for beginner projects to build with Javascript? Codeacademy and all is nice but I want to do something from scratch with no hand-holding.

jackpot
Aug 31, 2004

First cousin to the Black Rabbit himself. Such was Woundwort's monument...and perhaps it would not have displeased him.<

fletcher posted:

Do those styles actually come from an external stylesheet or is it a <style> block?
They're external. I read somewhere that hinted it might have something to do with my folder structure and how/where sass spits everything out, but there's nothing funky going on, it's just main.css in a css/ folder. Weird.

Kobayashi
Aug 13, 2004

by Nyc_Tattoo
I think I've posted about this before, but I'm working on a Node app that uses a lot of third party packages and I'm annoyed by the different styles. Some use callbacks, some use events, and some use promises. Some just throw exceptions all over the place, ugh. All of these behaviors tend to "bubble up" through my application logic. I feel like I should pick one style (events seem to result in the "flattest" code to me) and wrap non-conforming libraries in a homogenizing layer. Is this normal? How do other people handle this?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
They rewrite all non-conforming libraries.

enthe0s
Oct 24, 2010

In another few hours, the sun will rise!
Has there been any must read book on JavaScript since Crockford's "The Good Parts"? It was released in 2008, so I was wondering if there was a more recently released book that I should read instead.

kedo
Nov 27, 2007

jackpot posted:

They're external. I read somewhere that hinted it might have something to do with my folder structure and how/where sass spits everything out, but there's nothing funky going on, it's just main.css in a css/ folder. Weird.

Is your .css.map where it should be?

streetlamp
May 7, 2007

Danny likes his party hat
He does not like his banana hat

enthe0s posted:

Has there been any must read book on JavaScript since Crockford's "The Good Parts"? It was released in 2008, so I was wondering if there was a more recently released book that I should read instead.

I really like this as an introduction http://eloquentjavascript.net/
and its free to read online!

Adbot
ADBOT LOVES YOU

Withnail
Feb 11, 2004
Does anyone have a good solution for fixed table headers (scrolling table body) that works in IE9?

I can't believe my googling sucks that bad.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply