I am new to javascript and I need help with this. I want to store a number of videos in a js file in the format I have it below.
Here is the videos.js file
<script>
videos {
monthly {
january
{
240 : 'linktojanuary240.mp4',
360 : 'linktojanuary360.mp4',
480 : 'linktojanuary480.mp4',
720 : 'linktojanuary720.mp4'
},
february
{
240 : 'linktofebruary240.mp4',
360 : 'linktofebruary360.mp4',
480 : 'linktofebruary480.mp4',
720 : 'linktofebruary720.mp4'
}
};
family {
children
{
240 : 'linktochildren240.mp4',
360 : 'linktochildren360.mp4',
480 : 'linktochildren480.mp4',
720 : 'linktochildren720.mp4'
},
parent
{
240 : 'linktoparent240.mp4',
360 : 'linktoparent360.mp4',
480 : 'linktoparent480.mp4',
720 : 'linktoparent720.mp4'
}
};
};
</script>
**And here is the index.html file **
<html>
<head>
</head>
<body>
<h3> Monthly </h3>
<h1>january</h1>
<a href="linktojanuary240p.mp4" data-role="button" data-inline="true" data-mini="true">240p </a>
<a href='linktojanuary360p.mp4' data-role="button" data-inline="true" data-mini="true">360p </a>
<a href='linktojanuary480p.mp4' data-role="button" data-inline="true" data-mini="true">480p </a>
<a href='linktojanuary720p.mp4' data-role="button" data-inline="true" data-mini="true">720p </a>
<h1>february</h1>
<a href="linktofebruary240p.mp4" data-role="button" data-inline="true" data-mini="true">240p </a>
<a href='linktofebruary360p.mp4' data-role="button" data-inline="true" data-mini="true">360p </a>
<a href='linktofebruary480p.mp4' data-role="button" data-inline="true" data-mini="true">480p </a>
<a href='linktofebruary720p.mp4' data-role="button" data-inline="true" data-mini="true">720p </a>
<h3> family </h3>
<h1>children</h1>
<a href="linktochildren240p.mp4" data-role="button" data-inline="true" data-mini="true">240p </a>
<a href='linktochildren360p.mp4' data-role="button" data-inline="true" data-mini="true">360p </a>
<a href='linktochildren480p.mp4' data-role="button" data-inline="true" data-mini="true">480p </a>
<a href='linktochildren720p.mp4' data-role="button" data-inline="true" data-mini="true">720p </a>
<h1>parent</h1>
<a href="linktoparent240p.mp4" data-role="button" data-inline="true" data-mini="true">240p </a>
<a href='linktoparent360p.mp4' data-role="button" data-inline="true" data-mini="true">360p </a>
<a href='linktoparent480p.mp4' data-role="button" data-inline="true" data-mini="true">480p </a>
<a href='linktoparent720p.mp4' data-role="button" data-inline="true" data-mini="true">720p </a>
</body>
I currently update the html manually but it takes too much time and the file gets bigger. I would like to just update new videos on the videos.js file and have the html generated and styled automatically.
If you have a better way I can do this, kindly let me know. Otherwise, kindly help with that. Thanks.
for (foo in bar) ...?videoslooks incomplete.;that are in places they should not be