coffeehoock
4/17/2017 - 12:12 PM

js_location

js_location



// object ******************************************


var myOb1 = {
	name: "obj 1",
	getname: function(age){
		console.log("I love fucking coffee", this.name, age);
	}
};

var myOb2 = {
	name: "obj 2"
};
// bind method
// myOb1.getname.bind(myOb2)();
myOb1.getname.bind(myOb2)(33);

// call method
myOb1.getname.call(myOb2, 77);

// apply method and arguments
function bainding(newcontext, newfunction){
	return function(){
		newfunction.apply(newcontext, arguments);
	}
};
// все параметры (22) попадут в массив  arguments
bainding(myOb2, myOb1.getname)(22);



var content = document.body.childNodes[3];
	var scr = 	screen.width + ' ' + 'X' + ' ' + screen.height;
	var textA = 'вфше разрешение экрана';
	var textb = 'вфшa операцыонная система';


	content.innerHTML = textA + "</br>" + 
						scr + "</br>" + 
						textb  + "</br>" + 
						navigator.platform + "</br>";

var pathSite = document.body.childNodes[5];
	var textV = 'имя хоста';
	var textG = 'путь';
	
	pathSite.innerHTML = textV + ' ' +
	"<a href=\"http://188.243.241.229/\"> " + location.host + "</a>" +
						" " + textG + " " +
	"<a href=\"http://188.243.241.229/PUBLIC/\">" + location.pathname  + "</a>";