• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

Javascript/Html help

XeonGX

New Member
Javascript/Html help - FIXED :)

Hello everyone
I was wondering if there is a way to make the following code for embedding flv shorter. Note the blue URLs, they are the ones that change.

EDIT: Check post #3

Code:
<script type="text/javascript">
document.write(video(http://www.nibbler.at/republicofideas.flv));
</script>
It may be possible with javascript functions, but I don't know how to write javascript codes.

Thanks :)
 
Last edited:
@Dark Matter
I checked the site, thanks :)

___________
I read some w3schools pages about functions, I tried to create my own.

Code:
		<script type="text/javascript">
		function(video)
		{
		document.write('<embed src="' + video + '" width="575" height="400" allowscriptaccess="always" allowfullscreen="true" flashvars="height=400&width=575"/>')
		}
		</script>

Code:
			<!-- Video Player Start -->
			<div id="player">
			<script type="text/javascript">
			document.write(video('http://someurl.com/video.flv'));
			</script>
			<!-- Video Player End -->

I don't really care about the embed code atm, I'm just trying to get the basic function to work. This code is somewhat what I'm looking for, but it doesn't work.


EDIT: Wooohooo
I got it to work, :p

Code:
<script type="text/javascript">
function player(video)
{
document.write('<embed src="' + video + '" width="575" height="400" allowscriptaccess="always" allowfullscreen="true" flashvars="height=400&width=575"/>')
}
</script>
<p>Blah Blah BLah</p>
<script type="text/javascript">
player('http://site.com/video.flv');
</script>


Javascript is soo cool :)
 
Last edited:
Back
Top