[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

I'm making a website and I want to be able to make HTML

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 14
Thread images: 4

File: 1390937946904.jpg (89KB, 960x960px) Image search: [Google]
1390937946904.jpg
89KB, 960x960px
I'm making a website and I want to be able to make HTML elements which will hide themselves once it's a certain day (ie. I want elements that will "expire")

Anyone know how I would go about achieving this? Probably something with javascript?
>>
Let's see them armpits and then we can talk
>>
>>58533957
Use the Date class and a CSS display:none style
>>
>>58533957
>>58534126
its install gentoo you massive faggot


OP, you're doing it wrong, you will hung up at every corner, just go learn xml basics, then html5, static css3, and javascript basic

should take you a week, then you can make your website in a day, your step-by-step problem solving will have you 2 months learning nothing and accomplishing very little
>>
>>58533957
Javascript (client-side) is fine as long as hiding the elements is just for convenience. Users would potentially be able to see the hidden elements by tweaking the Javascript.

If users must not be able to see the hidden elements on a different day for whatever reason, you'll have to look in to server side scripting options (which could still involve Javascript if you use Node)
>>
>>58534201
This.
>>
>>58534126
Link to 25 js libraries including whatever library is the hot meme this week. Angular? React? Poo.js?

On the back end use a mix of SQL, ASP.NET web service calls, and PHP. Oh, and mix in some Ruby.

Don't forget to join 30 ad networks with tracking.

Your final page should require 30MB of downloads compressed and should randomly pop up and slide in ads and surveys.
>>
You can do it easy with vanilla js retard.
>>
For your usecase you might want to use PHP
I know, I know
>php

Alternatively send the html with the content you want from <insert your favorite backend server application>
>>
Here's what I have so far

<p class="scoobs" date="1/16/2017">Hi</p>

<script>
var theDate = new Date();
var parsedDate = Date.parse(theDate);
var x = document.getElementsByClassName("scoobs");

for (i = 0; i < x.length; i++) {
var expireDate = Date.parse(x[i].getAttribute("date"));
if (theFullDateObject > expireDate) {
x[i].style.display = 'none';
}
}
</script>

It seems like it should work but for some reason it fails at the if statement. Is there something I'm missing?
>>
>>58535320
>theFullDateObject

oops, this is actually parsedDate as it should be
>>
File: 1469582960926.jpg (155KB, 775x1376px) Image search: [Google]
1469582960926.jpg
155KB, 775x1376px
nvm figured it out
>>
>>58534389
>Angular? React? Poo.js?

It's Angular
>>
File: 1298235617447.jpg (30KB, 180x180px) Image search: [Google]
1298235617447.jpg
30KB, 180x180px
it's so fucking bonerific when you bang your head against your computer for hours and then it does what you want it to do
Thread posts: 14
Thread images: 4


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.