Steve_M
TVWBB Guru
HTML and JS aren't really my strong suit, I tend to stick to managing and deploying apps!
Anyways, rather than making new accounts other forums, I'm seeing if someone might be able to lend me a hand here first.
Rather than make 8 different html pages, each with a hard coded bitrate, I'd like to use javascript for this. I've already got the main html file created in a static format where it's got a list of links such as:
What I'd like to do is have a dropdown box where I can select from a bitrate
2) Have a base URL defined in a variable ie id="tvtuner" href="http://my.tv.tuner/auto/"
I assume I'll need to turn all the existing hrefs into JS functions and call them as such. This is where I need help.
Something like:
Then my href should be something like:
or maybe
Can anyone help me tie it all together?
Anyways, rather than making new accounts other forums, I'm seeing if someone might be able to lend me a hand here first.
Rather than make 8 different html pages, each with a hard coded bitrate, I'd like to use javascript for this. I've already got the main html file created in a static format where it's got a list of links such as:
Code:
<td> <a href="http://my.tv.tuner/auto/v7.1?transcode=internet360">
<img src="icons/ABC_us.jpg" style="width: 300px; height: 250px;" alt="ABC"/></a></img></td>
<td> <a href="http://my.tv.tuner/auto/v4.1?transcode=internet360">
<img src="icons/CBS02_us.jpg" style="width: 300px; height: 250px;" alt="CBS"/></a></img></td>
<td> <a href="http://my.tv.tuner/auto/v2.1?transcode=internet360">
<img src="icons/NBCHD.jpg" style="width: 300px; height: 250px;" alt="NBC"/></a></img></td>
What I'd like to do is have a dropdown box where I can select from a bitrate
Code:
<div class="dropdown-bitrates">
<select id="bitrate" name="bit_rates">
<option value="internet360">360</option>
...
...
...
<option value="internet720">720</option>
</div>
2) Have a base URL defined in a variable ie id="tvtuner" href="http://my.tv.tuner/auto/"
I assume I'll need to turn all the existing hrefs into JS functions and call them as such. This is where I need help.
Something like:
Code:
<script type="text/javascript">
function 7_1() {
var sel = document.getElementById('bitrate');
sel.onchange = function() {
document.getElementById("tvtuner").href = + "v7.1?transcode=" + this.value;
}
}
function 4_1() {
var sel = document.getElementById('bitrate');
sel.onchange = function() {
document.getElementById("tvtuner").href = + "v4.1?transcode=" + this.value;
}
}
</script>
Then my href should be something like:
Code:
<a href="javascript:7_1();">
or maybe
Code:
<a href="javascript:void(0);" onclick="javascript:7_1();">
Can anyone help me tie it all together?
Last edited: