<script type="text/javascript">
//GET DATA FROM URL ...index.html?PageTitle,YOUTUBE_ID
var DATA = window.location.search.replace("?", "");
//STORE IN ARRAY FOR EASY ACCESS AND EXPANDABILITY
DATA = DATA.split(",");
//LOAD THE PAGE TITLE
document.title = DATA[0]
//UPDATE THE IFRAME SRC AFTER THE DOCUMENT LOADS
window.onload = function() {
var YouTube = document.getElementById('YouTube');
YouTube.src = "http://www.youtube.com/embed/" + DATA[1]
};
</script>
<div class='content'>
<iframe id="YouTube" width="853" height="480"
frameborder="0" allowfullscreen>
</div>
I've got this code above, which allows me to change my websites embedded video depending on what the user inputs in the url.
The standard url goes www.mysite.com/index.html/?,
and then obviously the video code on the end.
How could I rewrite this code so there is no comma after the question mark?
or if possible no question mark at all so just www.mysite.com/index.html/videocode
NOTE: the comma is intentional in the standard url example.