...

View Full Version : How does this script work?



FootballDizzle
09-26-2012, 03:22 PM
Greetings,

My friend runs a website which displays video streams which are hosted elsewhere. In the past, he used simple Iframes, but now he uses Javascript. I'd like to ask him how it works, but he is always is very busy working so I never see the chance to ask.

I thought you all may help me understand this a bit more.


<script type='text/javascript'>id='gghghhgjjgh_19010'; width='640'; height='460';</script><script type='text/javascript'
src='http://espnwatch.net/player.js'></script>

How does this work? I assume the id= calls another file (js?). The rest is pretty self explainatory.

Thank you mates.

WolfShade
09-26-2012, 03:50 PM
Within the first script tag, variables are being initialized and given value.

The second script tag 'includes' a .js file from an external source. If you enter that URL in a browser, it will display the JS code in clear text.

FootballDizzle
09-26-2012, 06:14 PM
Within the first script tag, variables are being initialized and given value.

The second script tag 'includes' a .js file from an external source. If you enter that URL in a browser, it will display the JS code in clear text.

Greetings WolfShade.

Thank you very much for your response. I appreciate this!

I will attempt entering the .js into browser. :)

May I also add, I know that the espn js is not the "default" player for my friend videos. For example, if he hosts video on a site like "wcast tv", the automated script they give is
<script type="text/javascript" src="http://www.wcast.tv/embed.js"></script>.

Using ESPN player JS (I believe) allows the advertisements which WCast places on their player.

Is there any good places where I can read more about these types of scripts? I would like to learn but my Java/script experience is about 0. :)

Also. Thank you for taking the time to address what I imagine is a very elementary question.


Thanks you.

WolfShade
09-26-2012, 06:53 PM
If you want to learn JavaScript, you probably do not want to start by trying to translate code from players. There is so much more to JavaScript.

This forum is an excellent source for learning by asking questions about code. Mostly, this forum is for troubleshooting existing code, but advice is also given on code that has not yet been written.

Books are a good bet, too. Anything by O'Reilly Press is good; SitePoint is good, too.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum