Youtube API

Basic Player

	// Javascript
	var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var player;
function onYouTubeIframeAPIReady() {
    player = new YT.Player('player', {
        height: '390',
        width: '640',
        videoId: 'x_BswMKAlCY',
        playerVars: { 'autoplay': 1, 'controls': 1 },
        events: {
            'onReady': onPlayerReady,
                'onStateChange': onPlayerStateChange
        }
    });
}
function onPlayerReady(event) {
    event.target.playVideo();

}
function onPlayerStateChange(event) {
}

Youtube Search
	
// Javascript
function YouTubeSearch(){
//Get users search / clean string before running query
//Check results - objects - split - build
//Display results.	
}

Demo
Pop-Out Dock

Search API

Ajax Form

Basic Ajax Posting

// Javascript 
function comment(){
var name= document.getElementById("name");
var comment= document.getElementById("comment");
var hr = new XMLHttpRequest();
var url = "AddComment.php";
var vars = "name="+name.value+"&comment;="+comment.value;
 hr.open("POST", url, true);
 hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
 hr.onreadystatechange = function() {
if(hr.readyState == 4 && hr.status == 200) {
  var return_data = hr.responseText;
  var target = document.getElementById('MyComments');
  var ElementType = document.createElement('p');
ElementType.setAttribute('align', 'center');
target.appendChild(ElementType);
ElementType.innerHTML=return_data;
}}
hr.send(vars);
}

Multipart Form
Insert function information here and display the code below.

//No Javascript Added

E-mail Form
Insert function information here and display the code below.

//No Javascript Added

Pre-Coded Javascript

Get Elements By Id
This function will clean up your javascript, replace document.getElementById("YourId"); with _ebi("YourId");
This will call a function and return the element.

function _ebi(a){
return document.getElementById(a);
}

Building Elements On The Fly
t=Tagert, e=Element Type, a=Attributes, d=Data/InnerHTML

function build(t,e,a,d){
var target = document.getElementById(t);
var element = document.createElement(e);
if(a!==""){
	var attributes=a.split('|');
	for (i = 0; i < attributes.length; i++) { 
	    var ap=attributes[i].split('¬');
	  element.setAttribute(ap[0], ap[1]);
	}
}
target.appendChild(element);
	if(d!==""){
	  element.innerHTML=d;
	}
}
Call function to build the element.
build('Container', 'div','class¬buttons','Hello');

Pagiation

PHP Pagiation
Insert function information here and display the code below.

/* No CSS Added */
//No Javascript Added
//No PHP Added

Ajax Pagiation
Insert function information here and display the code below.

//No Javascript Added