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
Raskolnikov2089
Nov 3, 2006

Schizzy to the matic

Lumpy posted:

Why not store the URLs in the data attributes? Plus, you have a lot of markup you don't need... why are there DIVs in there at all? Here's a crappy example making LIs have different BG colors based on a data attribute: http://jsfiddle.net/kvvz6tj7/

I'm sure someone will beat me to it, but I'll code up a working version of what you want in a couple hours, as it's a pretty cool thing.

In your example .each(), what does the idx argument accomplish? I removed it http://jsfiddle.net/kvvz6tj7/3/ and it still seems to function the same. Is it a best practice to put something there when you use .each()?

Adbot
ADBOT LOVES YOU

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Raskolnikov2089 posted:

In your example .each(), what does the idx argument accomplish? I removed it http://jsfiddle.net/kvvz6tj7/3/ and it still seems to function the same. Is it a best practice to put something there when you use .each()?

I just stuck it in there out of habit. It's passed as the index of the array element you are currently iterating on. You are correct that it is unused and can be removed in my code.

streetlamp
May 7, 2007

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

Blinkz0rz posted:

Except WordPress which only really scales if you throw more horsepower at it. Try load-balancing it and see what happens. Hope you don't have anything stored in the media library!

HyperDB yo (and nginx, memcached, etc)
What part of WP doesn't scale as well as any other PHP CMS?

v1nce
Sep 19, 2004

Plant your brassicas in may and cover them in mulch.
If you're using Wordpress as a CMS to present a mostly static site, just throw a correctly configured instance of Varnish in front of it and you've got all the scalability you need.

Examples of large websites using Wordpress: https://wordpress.org/showcase/flavor/wordpress-org/

Don't use a CMS platform if you're building an application. Don't write a fully featured CMS on an application platform, unless you really hate yourself.
Or, you can also make a system which is a hybrid of both an application framework and Wordpress, if you like a challenge and also still hate yourself.

Tool for a job, people.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

streetlamp posted:

HyperDB yo (and nginx, memcached, etc)
What part of WP doesn't scale as well as any other PHP CMS?

anything in wp-content

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
And what I mean by that is that there's no really good way of putting common files (i.e. user uploads) on storage that's not on the server.

Thus, you run the risk, if you're trying to load balance on AWS, for instance, of users uploading data that never gets propagated to other instances and gets wiped when the instances are pulled down.

Also there's the whole "we store absolute links in the database" thing.

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION
I'm trying to achieve something fairly simple, but notoriously fiddly. I want to have select lists that are themed, but will still bring up the native select list UI on mobile. I have tried jQuery UI but that has it's own UI when the list is used, and not only that but it doesn't play nice with Angular. I tried Angular UI select lists but they don't work because they use a completely different syntax altogether so they won't fire the native select UI on mobile.

Surely this is a common enough requirement that there's a solution somewhere already? Someone? Anyone?

v1nce
Sep 19, 2004

Plant your brassicas in may and cover them in mulch.

Blinkz0rz posted:

And what I mean by that is that there's no really good way of putting common files (i.e. user uploads) on storage that's not on the server.
Thus, you run the risk, if you're trying to load balance on AWS, for instance, of users uploading data that never gets propagated to other instances and gets wiped when the instances are pulled down.
I really only did a cursory google for this, but doesn't S3 Buckets take care of that?

Blinkz0rz posted:

Also there's the whole "we store absolute links in the database" thing.
I don't see how this is a problem you can hope to eliminate this in any CMS.
Also are you trying to load-balance by subdomain or something? Shouldn't you be doing something like a round-robin with varnish? Bonus points for also offloading your cookies/sessions to another server.


The Wizard of Poz posted:

I want to have select lists that are themed, but will still bring up the native select list UI on mobile. I tried Angular UI select lists but they won't fire the native select UI on mobile.
Can you supply a basic fiddle that shows your problem? There's nothing I haven't been able to achieve using Select2 in AngularJS. Mind you, ui-select2 has some serious shortcomings when you try to do really crazy stuff.

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION

v1nce posted:

Can you supply a basic fiddle that shows your problem? There's nothing I haven't been able to achieve using Select2 in AngularJS. Mind you, ui-select2 has some serious shortcomings when you try to do really crazy stuff.

Actually that's a perfect example of the problem I'm facing. If you open that page on mobile and click on any of the "Select2" dropdowns, you don't get the same native control that you get if you click on the plain dropdown at the top.

Example - this is what happens with a regular select list, you get this nice looking native UI to make your actual selection:



This is what happens with the Select2 select list, you get given a custom selection UI that is awful to use on mobile. Not only that, but it doesn't understand touch screens so if you try to scroll down by dragging and you happen to start your gesture on the select list, you get this awkward interaction where the list opens up and your gesture is ignored.



Basically I want something in the middle - I want the actual dropdown component to be themed via CSS, but for the native UI to be triggered when the select is tapped.

putin is a cunt fucked around with this message at 05:02 on Dec 3, 2014

streetlamp
May 7, 2007

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

Blinkz0rz posted:

And what I mean by that is that there's no really good way of putting common files (i.e. user uploads) on storage that's not on the server.

Thus, you run the risk, if you're trying to load balance on AWS, for instance, of users uploading data that never gets propagated to other instances and gets wiped when the instances are pulled down.

Also there's the whole "we store absolute links in the database" thing.

Like mirroring your uploads to a CDN and setting the upload_url_path option to point at it?

e: Not even sure why Im defending WP, but like v1nce said tool for a job

streetlamp fucked around with this message at 05:15 on Dec 3, 2014

yoyomama
Dec 28, 2008
Nevermind, the issue I was having resolved itself; hoping this either doesn't happen again or I figure out what went wrong when I uploaded those css files.

yoyomama fucked around with this message at 05:58 on Dec 3, 2014

v1nce
Sep 19, 2004

Plant your brassicas in may and cover them in mulch.

The Wizard of Poz posted:

If you open that page on mobile and click on any of the "Select2" dropdowns, you don't get the same native control that you get if you click on the plain dropdown at the top.
[...]
This is what happens with the Select2 select list, you get given a custom selection UI that is awful to use on mobile.
Not only that, but it doesn't understand touch screens so if you try to scroll down by dragging and you happen to start your gesture on the select list, you get this awkward interaction where the list opens up and your gesture is ignored.

Looks like that whole drag-opens-select thing is a bug with an unmerged fix. To get around it you can either pull that fix or wrap the element with a higher priority "touchstart" listener that prevents propagation if the device supports touch inputs.

The Wizard of Poz posted:

Basically I want something in the middle - I want the actual dropdown component to be themed via CSS, but for the native UI to be triggered when the select is tapped.

Unfortunately I can't offer you anything in the middle. I'd argue that Select2 gives you a whole lot of extra awesomeness (typeahead, infinite scroll via ajax, etc) that it's worth trying to make it work.
You can probably fix the whole tap-scroll thing by pulling down that fix, or as i said, wrapping it with a listener that prevents the operation.
You can probably make it a whole lot more friendly to use on mobile by styling the pop-out box (positions, widths, etc), or using scrollTo on select2-open event, to move it to the top of the window.

Maybe someone else can offer you better (easier) middle ground with another library, but I don't personally know of any.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

v1nce posted:

I really only did a cursory google for this, but doesn't S3 Buckets take care of that?

I don't see how this is a problem you can hope to eliminate this in any CMS.
Also are you trying to load-balance by subdomain or something? Shouldn't you be doing something like a round-robin with varnish? Bonus points for also offloading your cookies/sessions to another server.

I've seen S3 Buckets before but don't you think it's overkill to have to install a whole different filesystem just to get WordPress to store user generated file system artifacts separate from the application?

I was actually thinking about how you'd scale in AWS. Elastic Load Balancers let you spin up and shut down new instances based on load rather than having to maintain existing servers that may just go unused. If you're spinning up and shutting down servers user generated file system artifacts start to become a problem if a user uploads something on one instance but it never gets replicated across all of the instances.

All I really want is for someone to abstract WordPress's file handling so that when a user uploads something it could go anywhere and it would be up to developers to write destination plugins.

Also, next time you use WordPress take a look at the database. It actually stores the entire URL of resources in the database. To migrate from one domain to the other involves using a tool designed to do global find and replace in your database. That's pretty shoddy design, don't you think?

down with slavery
Dec 23, 2013
STOP QUOTING MY POSTS SO PEOPLE THAT AREN'T IDIOTS DON'T HAVE TO READ MY FUCKING TERRIBLE OPINIONS THANKS

Blinkz0rz posted:

I've seen S3 Buckets before but don't you think it's overkill to have to install a whole different filesystem just to get WordPress to store user generated file system artifacts separate from the application?

No? It's really easy to set up, and is pretty standard these days for many sites.

quote:

I was actually thinking about how you'd scale in AWS. Elastic Load Balancers let you spin up and shut down new instances based on load rather than having to maintain existing servers that may just go unused. If you're spinning up and shutting down servers user generated file system artifacts start to become a problem if a user uploads something on one instance but it never gets replicated across all of the instances.

Why limit yourself to AWS?

quote:

All I really want is for someone to abstract WordPress's file handling so that when a user uploads something it could go anywhere and it would be up to developers to write destination plugins.

Also, next time you use WordPress take a look at the database. It actually stores the entire URL of resources in the database. To migrate from one domain to the other involves using a tool designed to do global find and replace in your database. That's pretty shoddy design, don't you think?

http://wp-cli.org/

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

down with slavery posted:

No? It's really easy to set up, and is pretty standard these days for many sites.

I've never used it. If it's as easy as you say definitely worth another look.

quote:

Why limit yourself to AWS?

'Cause that's where our infrastructure is hosted? Dynamic scaling is a thing and WordPress just doesn't place nicely with it.


I know it and use it. I just think it's absurd to have to do a global find and replace for absolute urls in a database. That's terrible design. It would be simpler if they stored urls as relative and used the site url to assemble the full url.

Heskie
Aug 10, 2002

The Wizard of Poz posted:

I'm trying to achieve something fairly simple, but notoriously fiddly. I want to have select lists that are themed, but will still bring up the native select list UI on mobile. I have tried jQuery UI but that has it's own UI when the list is used, and not only that but it doesn't play nice with Angular. I tried Angular UI select lists but they don't work because they use a completely different syntax altogether so they won't fire the native select UI on mobile.

Surely this is a common enough requirement that there's a solution somewhere already? Someone? Anyone?

Check out this Codepen for a CSS only solution: http://codepen.io/ericrasch/pen/zjDBx

This is how I handled it on my latest project. Basically you wrap the select in a <div>, hide the overflow, set the select width to a value greater than 100% and use a no-repeatable background for the styled arrow.

I made a couple of slight modifications though, like positioning the arrow background with calc(). i.e.calc(100% - 20px) to position 20px from the right.

Its cross-browser and the select box works as expected using the device's native controls, all without relying on JS. It also means the browser will handle edge cases such as the menu appearing outside the browser window if required (see http://www.hanseri.no/a-closer-look-at-the-select-element/)

Heskie fucked around with this message at 15:19 on Dec 3, 2014

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

v1nce posted:

Don't use a CMS platform if you're building an application. Don't write a fully featured CMS on an application platform, unless you really hate yourself.

This is a very fine quote, and one worth remembering.

huhu
Feb 24, 2006
Edit: Wordpress is so much better than Blogger.

Question answered.

huhu fucked around with this message at 19:23 on Dec 3, 2014

revmoo
May 25, 2006

#basta
People still use Dreamweaver?

chami
Mar 28, 2011

Keep it classy, boys~
Fun Shoe

revmoo posted:

People still use Dreamweaver?

I had to open it up two months ago to quickly deal with an old newsletter email I had to get content into.

Today I just said "gently caress it" and used Sublime snippets to expedite remaking the entire thing in Zurb Ink.

(screw HTML emails) :bang:

kedo
Nov 27, 2007

My go-to solution for HTML emails these days is to say the following things to clients:

1) I will only use MailChimp.
2) You get one of X template options, which I will customize to a small degree (eg. MailChimp's designer templates with custom images and colors)
3) It costs about 10x my hourly rate.


Amazingly, I still sell them. Trust me, just do this.





But also yes, screw HTML emails.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



If you map a filesystem in Chrome's dev tools and start messing with the CSS values from mapped style sheets, it will save the changes automatically. That is, without me hitting a button that says "yes, I'd like to write this fuckery out to the file right now". It just obliterates whatever's there :catstare:

Good thing I found this out with a file I had open in the editor at the time cuz otherwise I'd be pissed. It does keep the structure of the file the same, but I use that UI as a scratch pad to mess around with changes that I don't want saved, so to me that's a totally irresponsible and insane decision - especially since there's apparently no explicit save.

So heads up.

epswing
Nov 4, 2003

Soiled Meat
Hello, web design champions!

My shop writes mostly desktop software, but we're pushing our reporting module out to the browser. We're using ASP.NET to generate and display half a dozen reports. Currently the html is bare, just an <h2> here and a <table> there, filled with rows from our database. We're looking to pay someone to make it pretty (for some measurement of pretty), because we lack the knowledge and/or gumption to do it ourselves.

Should I be looking to work with a photoshop guy to design the looks, give me a psd, and then take that to a pdf-to-html shop? Or am I looking for a guy who can both design it and write the html/css themselves (and what would his job title be)? Where are some good places to look for such people?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

epalm posted:

Hello, web design champions!

My shop writes mostly desktop software, but we're pushing our reporting module out to the browser. We're using ASP.NET to generate and display half a dozen reports. Currently the html is bare, just an <h2> here and a <table> there, filled with rows from our database. We're looking to pay someone to make it pretty (for some measurement of pretty), because we lack the knowledge and/or gumption to do it ourselves.

Should I be looking to work with a photoshop guy to design the looks, give me a psd, and then take that to a pdf-to-html shop? Or am I looking for a guy who can both design it and write the html/css themselves (and what would his job title be)? Where are some good places to look for such people?

Someone to do both and PM me. :D

The Dave
Sep 9, 2003

The UX is done? Or it just wasn't cared about?

Also could I charge your company a lot?

pipes!
Jul 10, 2001
Nap Ghost
Pretty ain't worth a thing if it's not usable.

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

epalm posted:

Hello, web design champions!

My shop writes mostly desktop software, but we're pushing our reporting module out to the browser. We're using ASP.NET to generate and display half a dozen reports. Currently the html is bare, just an <h2> here and a <table> there, filled with rows from our database. We're looking to pay someone to make it pretty (for some measurement of pretty), because we lack the knowledge and/or gumption to do it ourselves.

Should I be looking to work with a photoshop guy to design the looks, give me a psd, and then take that to a pdf-to-html shop? Or am I looking for a guy who can both design it and write the html/css themselves (and what would his job title be)? Where are some good places to look for such people?

I know it's totally outside what you're doing, but maybe take a look at http://www.geckoboard.com . We replaced probably 90% of our internal reporting with some well set up Geckoboards, and even if you don't use it you can steal the style/appearance.

revmoo
May 25, 2006

#basta
drat that is really cool. It could almost put me out of a job. Almost.

kedo
Nov 27, 2007

Has anyone run into bugs with responsive states in Safari lately? I'm seeing a weird issue where the CSS for my states is being applied, but Safari is only rendering portions of it correctly. For example, my main navigation gets moved offscreen and receives a more touch-friendly treatment at mobile dimensions, but Safari is ignoring the positioning values. Using the inspector I can see that it's getting the right CSS, it's just not using it.

Any ideas? Excessive browser resizing is sort of an edge case in my opinion, but this is driving me crazy and I'd like to fix it. No clue what to google.


e: Oh I forgot to mention, this only happens when I resize the window. If I refresh, everything renders correctly. But if I resize after the page has finished loading, poo poo be hosed.

kedo fucked around with this message at 01:03 on Dec 4, 2014

thegasman2000
Feb 12, 2005
Update my TFLC log? BOLLOCKS!
/
:backtowork:
So another project has landed in my lap... My new job :woop: is shoehorning a completely unsuitable software solution to bend to its will and its causing me headaches...

Its a simple use case. We collect your vehicle and pay you for it. So I am looking for the easiest way to develop an online app (current one is not online) where we, and the customer can add their details and book a collection. Now I can do it in php from scratch, my last project went that way and works fine, but wondered if their is a boilerplate for this sort of thing? Some features we need are:
sending job to drivers smart phones, only allowing a certain amount of booking a day, separated by AM/PM, driver can upload image with proof of ID on it and we can store this. So any ideas?

Chris!
Dec 2, 2004

E
So today Zurb have launched Foundation for Apps, "The first front-end framework created for developing fully responsive web apps."

Anybody tried it yet? It relies on Flexbox so IE9 and down aren't supported, and the examples actually seem quite buggy so far - but it is a first release, hopefully they can iron all that out and get something more usable soon.

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

thegasman2000 posted:

So another project has landed in my lap... My new job :woop: is shoehorning a completely unsuitable software solution to bend to its will and its causing me headaches...

Its a simple use case. We collect your vehicle and pay you for it. So I am looking for the easiest way to develop an online app (current one is not online) where we, and the customer can add their details and book a collection. Now I can do it in php from scratch, my last project went that way and works fine, but wondered if their is a boilerplate for this sort of thing? Some features we need are:
sending job to drivers smart phones, only allowing a certain amount of booking a day, separated by AM/PM, driver can upload image with proof of ID on it and we can store this. So any ideas?

Don't know if your scale is appropriate to it, but maybe check out Schedulicity: https://www.schedulicity.com/
It looks like a directory, but you can embed their booking button on your site/app and control booking intervals, availability, etc.

If you're googling around for existing code to adapt, the most common scenario I've seen for this is in hair salon bookings. A quick run at sourceforge ("appointment management") found me this:
http://sourceforge.net/projects/wass/?source=directory

You could probably find others on GitHub

The 'heavy' work is going to be the scheduling/conflict/availability, so it's understandable you'd want to avoid re-inventing the wheel on it unless you don't have to.

thegasman2000
Feb 12, 2005
Update my TFLC log? BOLLOCKS!
/
:backtowork:

Scaramouche posted:

[Good Words...]

The 'heavy' work is going to be the scheduling/conflict/availability, so it's understandable you'd want to avoid re-inventing the wheel on it unless you don't have to.

Thanks, yeah the availability bit has me worried... I think we wan to set a hard limit on bookings. So 10 before AM and 10 after. Only AM on saturdays. When 10 have been booked the user needs to not be able to select that date/time slot. I will have a look at hair appointments as that makes sense.

Any ideas on storing the images and writing the location to the database. I presume this is the best way. Bloody government requirement means they need to be kept for 10 years. Currently doing 120 ish cars a week.

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION

Heskie posted:

Check out this Codepen for a CSS only solution: http://codepen.io/ericrasch/pen/zjDBx

This is how I handled it on my latest project. Basically you wrap the select in a <div>, hide the overflow, set the select width to a value greater than 100% and use a no-repeatable background for the styled arrow.

I made a couple of slight modifications though, like positioning the arrow background with calc(). i.e.calc(100% - 20px) to position 20px from the right.

Its cross-browser and the select box works as expected using the device's native controls, all without relying on JS. It also means the browser will handle edge cases such as the menu appearing outside the browser window if required (see http://www.hanseri.no/a-closer-look-at-the-select-element/)

Holy poo poo, this is perfect! Thank you! Where would you like to meet to receive your blowjob?

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!

I'm trying to come up with a good IE8 fallback for inline SVG. For whatever reason IE8 doesn't simply ignore the <svg> tags, it throws a poo poo fit when it sees one and stops rendering the page correctly. So far I see two viable options.

The first one is outlined here. Conditional comments to block the <svg> tags from IE8 and load the fallback .png. Fine, but conditional comments are gross.

The second option is to use Modernizr (which I'm already using on the site for a couple other features). Basically, inject the <svg> into the page via JavaScript using Modernizr.inlinesvg. Supported browsers get the code, unsupported browsers get the fallback. This should work, but is it overkill?

Which of these is the better option?

darthbob88
Oct 13, 2011

YOSPOS
I have an impossible error. My company's service relies on a POST AJAX call, and for some reason the call body isn't always populating correctly. I can't reproduce it, but my boss keeps finding errors where the call goes through without the data that should be attached. I'm pretty sure it's not just IE flipping out over CORS, because in that case we shouldn't get a call at all, not just half of one like this. I doubt it's somebody with JS turned off, because again, we shouldn't get a call at all in that case. And it's definitely not legit, because if there isn't data to send, we shouldn't even be calling the service. What the hell kind of errors would cause a POST call to be sent without a body like this?

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
Have you tried logging the failing requests to see if there's any pattern in the user agents or anything else?

Are you sure they're not actually OPTIONS requests being used to preflight things?

v1nce
Sep 19, 2004

Plant your brassicas in may and cover them in mulch.

caiman posted:

The second option is to use Modernizr (which I'm already using on the site for a couple other features). Basically, inject the <svg> into the page via JavaScript using Modernizr.inlinesvg. Supported browsers get the code, unsupported browsers get the fallback. This should work, but is it overkill?

Yeah, do this. If you throw in conditional markup just for IE8 it's going to be a shambles to deal with in future, and you're using a solution that only works for one specific case.
On the other hand, Modernizr was built for dealing with browsers that are missing features, and will detect a failure to understand SVG on the browser and use the fallback. Plus in the future if you decide to drop support for browsers that don't understand SVG then you can just find+replace the calls to Modernizr and you're done.

darthbob88 posted:

I have an impossible error. My company's service relies on a POST AJAX call, and for some reason the call body isn't always populating correctly.

Is the POST data completely empty or just mangled? Do you have anything like logged devtools (F12) headers to look at?
Check the "Content-Type" header because, depending on your server-side framework, the different content types can end up in different parts of your request object.

For instance, in Symfony Content-Type: x-www-form-urlencoded populates variables in the Request object that can be fetched using ->get(), but Content-Type: application/json is only accessible via getContent(). That's also the difference between jQuery's $.ajax and AngularJS's $http service.

In Symfony you can add an interceptor to massage the data: http://silex.sensiolabs.org/doc/cookbook/json_request_body.html
Or in Angular you can override the Content-Type: http://victorblog.com/2012/12/20/make-angularjs-http-service-behave-like-jquery-ajax/
But now I'm just making wild assumptions about your front/back end.

Also, this should be pretty reproducible on the troubled machine if it's the case. If not, we could really use a look at the headers for the failed request.

darthbob88
Oct 13, 2011

YOSPOS

Jabor posted:

Have you tried logging the failing requests to see if there's any pattern in the user agents or anything else?
I've asked the guy who handles the service, but he doesn't have any details beyond "something keeps sending POST calls without a body". Will ask again, see if he has anything at all helpful.

quote:

Are you sure they're not actually OPTIONS requests being used to preflight things?
Maybe, but I don't think our call needs to be preflighted. It's a simple POST call, with a payload containing regular text/plain, and no custom headers as far as I can tell. Nothing unusual at all. Is there an easy way to detect this in C#, apart from the Method property?

v1nce posted:

Is the POST data completely empty or just mangled? Do you have anything like logged devtools (F12) headers to look at?
Uncertain and no. My boss handles the service, I handle the front-end stuff. Will persuade him to log the headers and more useful info.

quote:

Also, this should be pretty reproducible on the troubled machine if it's the case. If not, we could really use a look at the headers for the failed request.
I can't reproduce it anywhere. Every computer and browser I run the offending code in, it either works perfectly, or doesn't work at all, none of this half-assed business. And yes, I'd also like to see the headers for this failed request.

Adbot
ADBOT LOVES YOU

Heskie
Aug 10, 2002

caiman posted:

SVG and IE8

I'm looking at SVG's at the moment and came across this fallback technique:

code:
<img src="image.svg" onerror="this.src=image.png">
or

code:
if (!Modernizr.svg) { $("img[src$='.svg']") .attr("src", $this.src.replace("svg","png")); }
Obviously this doesnt account for inline <svg> tags though. Do you have a good resource on handling svg sprites?

edit:
Found a CSS Tricks list of SVG information, pretty handy since all my Googling was filled with pages of SVG Icon sets rather than useful info.

Heskie fucked around with this message at 12:44 on Dec 10, 2014

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