Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
D--M22667yI mean.... Thats one way to do it i guess....
You should look into jQuery if your just doing barebones html+js. -
Dude I am no web developer but using JavaScript and the DOM you can make a very simple for loop for this
-
Baguette4257yare you serious ?? Just do a loop in JS or in the backend before rendering it !!
This is a joke -
Thats exactly what people would rant about if they would see that in the wild, but now people cheer πΆ
Just quickly googling anything related to that brings up atleast 10 copy pastable results.
Also you could have used the linux shell via brace expansion {1900..2017}
Also excel has autocomplete, word has too iirc.
Also youre going to add each year a new entry now? piss poor implementation imho. -
You know there’s two letters you could add in your google searches...
“U” + “X”
It would save you a lot of time -
@ everyone
Calm down! It's not like it's going to kill you or anything.
My crime has been done and it's too late now. -
cursee165957yOk lessons learned, right? Here is another. π³
If I wanna write something like that, I would utilize on Office Excel/Libre Calc and my sublime text.
1) I will generate the number in excel. Copy the values.
2) I have Emmet installed on my sublime. So if I want 100 option tags, I just write option*100 and tab. Then paste.
Done. Just a few clicks will achieve that. I may not be smart but I sure am lazy π€ You gotta learn how to be lazy too girl. -
C0D4669027yWould have saved you the strain of that π
For(I = 1900; I<= 2017; I++){
// show an option with I
} -
@C0D4
I didn't think it through and I'm not a web developer so it didn't occur to me to use JavaScript right away. -
Emmet has an option to include some math in your snippet, with an increasing index.
If I had written this, I would have used a vim macro with Ctrl+A.
But then again, I wouldn't have written this... -
for(var i = 1917; I <= 2017; i++){
let option = document.createElement("option");
option.value = i;
option.innerHTML = i;
select.appendChild(option);
}
Something like this, I believe. -
I had to do some of those ugly stuff. Wrote one line of the code, recorded a macro that copied it, pasted it, incremented the number (c-a on vim), and then made the macro run the adequate number of times.
-
@lanesra
Because it's too late to fix it. I can't let that work go for nothing so I might as well embrace it :) -
@Michelle I really don't know if you're trolling anymore, but webdev has nothing to do with knowing that, you have listed a million languages in your profile, yet you failed to write a for loop in for ex. python and copy paste that output? Obviously to have it the correct way you would do it in Javascript (which you have listed too) or serverside, but as mentioned above - googling that, literally gives you tons of copy pastable results. Its simply disgusting to solve it manually or not the correct way anyway. Also listing 2017 makes no sense, nobody born in 2017 will likely register for a website, but thats just stomping on a smelly pile of shit anyway.
-
@Michelle lol I did , people here are pretty dense sometimes but to be fair it is hard to tell sometimes through text
-
@Michelle believable??! Even more, this was on troll goddess level u____u I salute you u____u
-
Keep it DRY--Don't Repeat Yourself
You can either write both backend or frontend script to automate this. -
coolq48207y@Michelle
I wasn't convinced, I knew you were smarter then that. Also you when you said:
"I'm a busy person, I don't have time for laziness".
It doesn't make sense.
If you're that short on time, then you'd come up with a better system. -
generator ? i did some web stuff for couple of my projects i generate lists even if i have only 4 options
-
Shisuki6037yNot buying the "troll" scenario.. I think you really did it, tried to embrace it but then crumbled under the pressure and took the safety net some of the guys been throwing at you so you called it a troll. But I disapprove of this approach..
Anyway, we all did stupid shit, not on that level, but we all did it. Still doing it.
Take it as an opportunity to level up and never be ashamed of it.
I believe in you @Michelle c: -
Badr21637yThe time you spent in writing this is more than the time required to build the whole website without it...
-
If you didn't want to dynamically do this you could've also just written a script to generate the barebones html for this lol
-
I’m gonna be a party popper and say that I would laugh so hard if that’s actually generated HTML without minification π
-
This COULD be done a lot quicker in JavaScript, but honestly, I would have probably had a backend engine do it instead, so the website wasn't completely broken for users with their JavaScript disabled, or for users with those no-script screen reading browser things.
Although I would be lying if I said I've never done this same exact thing before. And it was painful. -
@Shisuki
No, I was literally trolling. I'd never host this atrocity. I'd be too embarassed haha.
It doesn't take a genius to realize a shorter way of doing this. -
@Michelle this where regex comes into playground download sublime replace pattern matching to tags. only you need is number from 19**-20** ...
-
@ThatDude I use it more as a term of friendliness, without it I think the message would seem a bit too critical. I hate text
-
omom13597yOr you could even make a simple loop in whatever language you know, Java for example, and print this whole and copy paste it.. that's the dumbest thing I've seen..
-
github95487y@Michelle girl, u just made the best mock to most ranters this year. Would have hit you(friendly one) if you were near for mocking me too. ππ
-
techolik217yThat's a user unfriendly website you are building - what about people older than 117 years old?π
-
I mean, the problem I see with this is the size it'll need to send down the wire, if I just guesstimate based on the length of each row, this dropdown alone would be about 5-10 kB which may not look like a lot, but every byte we don't have to send to the end user that might be on a really slow connection is a happy end user that doesn't leave the site before it has loaded...
-
IndoDev4957yComments section in this post is so hilarious ππ good job for making a record of the longest comment in a single post I ever seen @Michelle π
Now I hope devRant has search option in for searching any word in a the post-comment section for easiness of navigation -
-
enzop12347y:^p
<?php
$start = 1900;
$end = 2017;
for ($i=$start;$i<=$end;$i++) {
echo '<option value="'.$i.'"> '.$i.' </option>';
} -
You could just let it be created as an array of strings with an for loop and paste it in, but its your time π
-
I am no web dev,but I would have made a C++ program to print all these in a loop inside a file,then would have copy pasted it. XD
Seeing the above comments about loop in js,I thinks thats the best way! -
@Nanos
Oh, thank you but you did't have to do that! I already know how this was a joke. But thank you so much, I appreciate it :) -
@Michelle I love your trolling!
@Nanos On these cases, I just use Excel or any program language I know and copy and paste the output.
For Excel:
First column <option value="
Second column 1940
Third column ">
Fourth column 1940
Fifth column </option>
Then just replicate everything to the following rows. Excel will increase all the numbers. After that, just concatenate and copy and paste. -
Back in college I saw something like this as a jscript code from a senior student project. We were told to rate the code so I gave a poor rating... They didn't take it so well
Another reason why I'm not a web developer... Having a user choose their year of birth with a drop down menu is a pain. I did it from 1900 - 2017 rip my fingers.
rant