WHAT'S NEW?
Loading...
Showing posts with label Java Scripting. Show all posts
Showing posts with label Java Scripting. Show all posts

I created a customize java script from other sources the will generate thumbnail images from youtube.com. It really took me a couple of hour to figure it out, because I was really confuse in different jquery script posted in the net.Now let me teach an easy way on how to generate a thumbnail image based from the given url. Ooops! my mistake! i wont teach you, instead i will show you the whole code including the java script the will generate YouTube thumbnail image.

For example this is your link: http://www.youtube.com/watch?v=HgIzOsMvN9A&feature=related

function getParameter(url) 
{
    var urlparts = url.split('?');
    if (urlparts.length > 1){
        var parameters = urlparts[1].split('&');
        for (var i = 0; i < parameters.length; i++){
            var paramparts = parameters[i].split('=');
            if (paramparts.length > 1) {
                return unescape(paramparts[1]);
            }
        }
    }
    return null;
}
function CreateThumbnail(frm){  
  var url;
  Embed = frm.txtVideoURL.value;
  url=getParameter(Embed);
  alert("http://img.youtube.com/vi/"+url+"/2.jpg");      
 }
<input id="inputVideoURL" name="txtVideoURL"type="text" />
<input name="action"onclick="CreateThumbnail(VideoForm);"type="submit" value="INSERT"/>


As you enter the Youtube video url to the textfield it will call back a url directory where the image thumbnail of Youtube is located.
Java Script is a web base program language. Every Web Developers use java scripting for the reason that  This is commonly use for user interference. When you say user interference,  It create an interface or communication between the website and its readers. Somehow , like other programming tools, it also have its advantages and disadvantage.


This advantage are the following:


1.Web 2.0 use java scripting for more interactive website.

2.Unlike the flash effects, java script is easy to load for its lightness. The readers is no longer need to have a fast internet connection just to read your article.

3.Java script is not server side. It process a transaction without loading the whole website like the PHP.


This Disadvantages are the following:

1.Not all Web Developers knows how to use java scripts. Others just get the java script frame work and inject it to their site. Their is no problem with java script framework injection, somehow in some instances there are issues of incompatibility of several scripting
that result of  website overloading.

2.Java script is also a common tool for the web hackers, they use script injection to hack a site. XSS or Cross side script is on of the attack made by java scripts.

3.Not all java script function is effective to a website. Ads pop up is one, it is very inconvenient for the user to read to many pop up from a site.

4.Java script is light, some how to much of java script can slow down the page loading of a website.