J Just Me New member Sep 30, 2009 #1 Let's say we have a URL like this. www.blahblahblah.com/watch?v=VIDEOID How can I take the string that was appended after ?v= and send it to a JavaScript variable? I am making a video site.
Let's say we have a URL like this. www.blahblahblah.com/watch?v=VIDEOID How can I take the string that was appended after ?v= and send it to a JavaScript variable? I am making a video site.
Y Yippee Guest Sep 30, 2009 #2 I'm not sure if JavaScript can do that or not. I think you need to use ajax. However, you can go roundabout a little with PHP. <?php echo '<script type="text/javascript">var videoID = ',$_GET['v'],'</script>'; ?>
I'm not sure if JavaScript can do that or not. I think you need to use ajax. However, you can go roundabout a little with PHP. <?php echo '<script type="text/javascript">var videoID = ',$_GET['v'],'</script>'; ?>