/wdg/ - Web Development General

Las thread: 'Had to use the fucking jQuery spaghetti screenshot because I'm too lazy to make a new one' edition

> Discord
discord.gg/0qLTzz5potDFXfdT

>IRC Channel
#Sup Forumswdg @ irc.rizon.net
Web client: rizon.net/chat

>Learning material
codecademy.com/
bento.io/
programming-motherfucker.com/
github.com/vhf/free-programming-books/blob/master/free-programming-books.md
theodinproject.com/
freecodecamp.com/
w3schools.com/
developer.mozilla.org/
codewars.com/
youtube.com/watch?v=JxAXlJEmNMg&feature=youtu.be&list=PL7664379246A246CB lecture series.

>Frontend development
github.com/dypsilon/frontend-dev-bookmarks

>Backend development
en.m.wikipedia.org/wiki/Comparison_of_web_application_frameworks
backendDevelopmentBookmarks.md

>Useful tools
pastebin.com/q5nB1Npt/
libraries.io/ - Discover new open source libraries, modules and frameworks and keep track of ones you depend upon.
developer.mozilla.org/en-US/docs/Web - Guides for HTML, CSS, JS, Web APIs & more.
programmableweb.com/ - List of public APIs

>NEET guide to web dev employment
pastebin.com/4YeJAUbT/
>How to get started
youtube.com/watch?v=pB0WvcxTbCA - "WATCH THIS IF YOU WANT TO BECOME A WEB DEVELOPER! - Web Development Career advice"
youtube.com/watch?v=zf_cb_Nw5zY) - "JavaScript is Easy" - If you can't into programming, you probably won't find a simpler introduction to JavaScript than this.


>cheap vps hosting in most western locations
lowendbox.com
digitalocean.com/
linode.com/
heroku.com/
leaseweb.com
openshift.com/
>NEW!
scaleway.com/

Other urls found in this thread:

Sup
blog.modulus.io/absolute-beginners-guide-to-nodejs
developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_applications
twitter.com/NSFWRedditVideo

anime is for fags

Anyone here familiar with flask? I'm learning flask but I get this to work

HTML:


Name



Comment: {{com}}

{{com}}


File input

Submit

Python:
#!/usr/bin/env python
from flask import Flask, redirect, render_template, url_for, request
from flask.ext.script import Manager
from flask.ext.bootstrap import Bootstrap
app = Flask(__name__)
bootstrap = Bootstrap(app)
@app.route('/', methods=['GET', 'POST'])
def index():
return render_template('index.html')
if request.method == 'POST':
comment = request.form['comment']
return render_template('index.html', com=comment)

@app.route('/user/')
def user(name):
return render_template('user.html', name=name)

if __name__ == '__main__':
app.run(debug=True)


Why won't the comment input appear in label?

Can you post an screenshot or something, user?

...

So you are pressing "Submit" with a non-blank comment, but the comment doesn't appear on your label, right? Or are you expecting the comment to render in realtime while you type?

>you you are pressing "Submit" with a non-blank comment, but the comment doesn't appear on your label, right?

Exactly

Hey guys question. So if php is a meme what should I use? Or what other options do I have? Preferably free

What is /wdg/ official and approved stack?

Oh right, the problem is your first return: you always render the template and never get to the condition.
Change your index() with:
@app.route('/', methods=['GET', 'POST'])
def index():
if request.method == 'POST':
comment = request.form['comment']
return render_template('index.html', com=comment)
return render_template('index.html')

Anything but PHP.

Thank you so much. I'm such a dumbass

php is in no way a meme, learning it is better than learning this week's HIP and COOL framework.

nice try, pajeet :^)

How do you select specific fields with the xml parser in javascript?

Like if I have several blocks with a similar naming scheme in a string and want to select them using a logical order.

Example:


Conf
This should be replaced by the Q


var txt, parser, xmlDoc;

txt = "

example


0.1
0.2
0.3
0.4
0.5
0.6

"

parser = new DOMParser();
xmlDoc = parser.parseFromString(txt,"text/xml");

qa = xmlDoc.querySelectorAll(".Q_conf_set")[0].querySelectorAll(".q6_conf")[0].getElementsByTagName("field")[0].childNodes[0].nodeValue;
var Q = qa + ", 0, 0, 0, 0, 0";
document.getElementsByTagName("p").innerHTML = Q;

nice try americuck nodejs shill, nobody gives a fuck that your new framework is reinventing the fucking wheel. people like you are the reasons web development has become a shitty meme perpetuated by new frameworks coming out every other week claiming to be the hottest new shit. fuck you, hang yourself you worthless scum.

>implying that I hate PHPajeet because I use anything related to cuck.js and memengoDB and not because is a clusterfuck of fuckness rotten to the core

So stop supporting shitty standards? use php7 and PDO. the only thing wrong with php is the people that use it.

...

This.. the only people that hate PHP can't properly use it.

Sup Forums.org/index.php

I like php it was easier to pick up than perl in the cgi-bin.
OOphp needs to die though, php should be procedural.

Does anyone here have experience with CherryPy?

Why? OOP is easy

I'm learning how to implement HTML5 videos to a website, but for some reason when I try playing them on android, I get a message that the video format or mime is not supported.

Source file is .mp4, should I be including a source in a different format for mobile? What would be best in terms of size and format?

.mp4 should be fine.

mime type error is usually a server thing

Does anyone know of a resource on node.js?
I want to know how to get it to work, not how I should write the code.

I want to know about how to set things up.

Pajeets have a hard time understanding it, it seems

Thanks. Do you know if I should be including a smaller resolution file as well, so it loads faster on android maybe?

So I can't diagnose this myself, I'd have to contact the website admin? I'm using HTML and AjaXplorer to do this.

learning reactJS is giving me a headache.
I cant progress.
My table just isnt showing uo and no one in my company knows react.js

pls sympathize.

Nodejs is just running a java program as a server.

I learned some of the OOP stuff I know from pajeet youtube videos ironically.

its ez as piss mate

blog.modulus.io/absolute-beginners-guide-to-nodejs

>I learned some of the OOP stuff I know from pajeet youtube videos ironically.
That explains why you think Node.js is Java

>Nodejs is just running a java program as a server.
spotted the CS major

Maybe, I haven't slept for the last 4 days.

I thought it was a C program
when I type node in a terminal, it exits right away... How do I get error messages and stuff?

Is there anyone here using more uncommon web tech? For example Erlang/Elixir, Common Lisp or Scheme, Haskell, C etc.

I'm thinking of getting running with Common Lisp and Hunchentoot.

nodejs is v8 js engine as a server
faggot

C# aspnetcore, fucking boss wants the bleeding edge on everything.

ah... The guide is wrong.... You should use nodejs instead of node...
What is the other application for?

My mistake then

Guys, tabs or spaces?

tabs

i use spaces here and there to keep everything aligned

what version of linux are you using?

I use ubuntu 14.04.

Anything that doesn't force me to press the backspace button several times or any button for that matter

He asked what version of Linux you use, not what version of Ubuntu

The only people that hate PHP are the ones that have used any language that isn't a retarded_mysqld_convoluted_way_of_doing_stuff1(func). Not to mention it from a language analysis and grammar perspective.
PHP was designed by morons. It has its uses but stop selling it as the best thing ever pajeet

well the kernel version would not affect if the binary is called node or nodejs.
Clearly he was asking about the packaging, so I thought the shortest answer would be to tell him what made sense in the context.

THEN STOP USING DEPRECATED MYSQL FUNCTIONS AND FUCKING USE PDO REEEE

Why are you trying to re-invent the wheel and not use a proper framework?

Maybe a more relevant question:

I have a website (single html file) which takes in a lot of javascript functions. The variables is stored in the browser of whoever receives this html file.

How do I send a variable from the browser to an application on the server?

I was thinking I could use nodejs as I can use sockets from there, but I am not sure I am doing this right.

In the end I should get the value on a C++ application on the server (probably using zmq), but I don't know if I even can do this with nodejs?

Is there a reason that when putting javascript into a site, some things only work when the script is written into the body of the html? I liked the idea of having all js on an external page that I can link to in the header but whenever I do that, I can't get some stuff to run.

Anyone here with advanced web integration experienced?

I'm trying to do the following:
- create WP frontend for customers to register for an event

- use SuiteCRM as backend

- use RabbitMQ as the communicating tool between the 2.

Anyone here with integration experience?

It's how js loads, try rearranging your scripts.

...

HOLY SHIT EVEN THE FUCKING HELLO WORLD TUTORIAL DOESNT SHOW ANTHING WTF REEEEEEEEEEEEEEEE

does anyone know?
Or does anyone know what I should be looking for?

I used a framework when I had to work in PHP user ^_^
Most people don't though and that's your bad luck if you ever have to maintain that.
But I always used PDO and frameworks :^)
Stop browsing Sup Forums at work, you will get fired.

You can skip node and just use sockets with C++

okay. How do you use sockets in javascript then?
Are there some good libraries?
I have no problem with c++ to c++ communication, but I am completely new to the web site of things.

Trying to set up a test page with html, and I have two videos centered in one line, with space between them.

When I open it on an android browser and view it sideways, it looks like this. I don't get it, how do I have them aligned, but also have space between them?

I've used several. Someone please kill the people that produced CakePHP.

MEAN and LEMP

I used Codeigniter. Dunno what's the general sentiment about it. It was alright for my needs.

I prefer the KEK stack

>Not using the MEME stack or the PEPE stack
It's like you want your startup to fail because it wasn't dank enough

developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_applications

Don't count on legacy support.

cool thanks..

>MEME stack
>MySQL
>Express.js
>MathML
>Erlang

I have a question, if anyone would be able to help with an opinion or tip.


I'm using Threejs to render canvas contents to a texture to go on a sphere. Recently realised I need an alpha map to go with it for partial transparency, in some places.

Trouble is, I render these textures in realtime based on users' input, with multiple instances of these canvases, one for each user, before putting it all together onto the texture for the sphere.

I need to be as close to 60fps as I can get.

--

Would anyone be able to recommend which way would be better to go about this, keeping in mind performance:

• rendering both texture and alpha map canvases at the same time, for each user
• parsing the users/final texture and taking out the alpha data, and rendering the alpha map from that
• something else..?


Option 1 seems to be the most straight-forward, and I've started working on that, but it would probably nearly halve the number of concurrent users I can have.

Option 2 seems like the cleaner way to go about doing things, but the textures are fairly large, 4x the viewport size, and iterating through its imageData takes a long time, definitely not a 60fps approach.

--

Thank you for any help, I appreciate it.

>not using TempleOS in his web stack
what is this, 1987?

Doesn't specify an OS (MEME doesn't have a T in it), you can use TempleOS if you want.

Good luck getting networking though.

>Do you have whitespace in your HTML code?
this is actually the worst thing about HTML desu, who thought it was a good idea for a newline to be interpreted as a space?

months start at 0, so 8 is september and only has 30 days.

Haters gonna hate

Nice meme.

Cancer and AIDS are likewise infamous.

kek, it's true, it's famous and there are several job openings... even where I'm applying as a C# Web dev, there's a more senior position for PHP... fug.
I will admit, I started doing web design in Frontpage and Web Development in PHP, modding shit in Invision Power Board and phpBB.
Met some cool people in different forums when I was just a wee lad doing amateur scripting. So yeah, php... you might be ugly and fucked up beyond recognition internally but you were my first...

Both make the world a better place.

kek

kek, edgy but I laughed
>AIDS
yea, purge the fags
>cancer
nah bruv, some real good people I've met died of that. it sucks hard. You see them wither and fade day to day until they are gone. Like tears in rain

question about formatting. The money sign is part of this image. Looks great when customer uses/purchases a gift cert of a 2 digit amount. However if they go 3 digits (100 bucks are higher) the "1" in the "100" overlaps the money sign. I tried moving the amount to the right, which made it looks good for a 3 digit amount, but then a 2 digit amount leaves a large space between the money sign and the amount. Suggestions?

don't make the $ sign part of the image.
use a smaller font for 3 digits to make it fit

Maybe increase/decrease the font-size depending on the length/size of the text? I don't know how much leverage you have with the formatting and how dynamic it might be.
Just a thought if you want your content to fill the circle.
Looks qt btw

PHP truly is the best language.

Thanks. I wrote a script that took care of it

//adjust GC price font size if 100 dollars are more
var GCBalanceStr = document.getElementById("ctl00_ctl00_NestedMaster_PageContent_Balance");
if (GCBalanceStr.innerHTML.length == 3) {
GCBalanceStr.style.fontSize = "55px";
GCBalanceStr.style.position = "relative";
GCBalanceStr.style.top = "20px";
}
else if (GCBalanceStr.innerHTML.length >= 4) {
GCBalanceStr.style.fontSize = "37px";
GCBalanceStr.style.position = "relative";
GCBalanceStr.style.top = "35px";
}

Core is being released in a couple days, and it's a huge improvement over MVC5 and previous iterations. You have nothing to complain about.

don't do that.
at least only change the elements class and control it with css instead of hardcoding something like this.

if you're already using asp.net you could do that on the server side.
and why the fuck are you still using webforms.
also you can disable id inheritance in the web.config to avoid having hundreds of ctl00_ctl00 etc.

can't you combine the $ and the number into one string which you center with flexbox?

Lads, which one should I use?
In terms of user friendliness and useful/up to date documentation, which one of these is the best?

it's an older website i guess. Lots of our web apps still use it. I think I prefer having the id inheritance because then I can control what I want and not give it id's manually. I'm pretty new to asp.net. I honestly have no idea how to dynamically format something like this with just CSS. What exactly is wrong with vanilla js?

Koa.js Ember.js Karma (for testing)

It could work

not formatting with css dynamically.
but using classes instead of setting css values with JS.
separate your code and markup.
if you want to change something you now have to dig into the markup/js files to change styling compared to changing it in your css file.

but again, for what you are trying to do you could just make your own server side control that puts its classes exactly like you need already, then you don't need to check with JS.
it's unnecessary bloat.

so i could have done it using just asp.net? do you mind pointing me in the right direction of how i would set up a control that would do this?

post a jsfiddle, bitch

All shit.

>nodejs shill

I went with compiling both the normal and alpha map. Performance seemed ok, though, I've not tested with many users, so who knows..