Here i have some code to create div with specified class, and inside of this div i create iframe to connect to my chat widget
(function(){ 
var client_id = '1',
    p= 'right',
    vp = 'bottom';
    h = '550',
    dw = '400';
var d=document;
var w=window;
function l(){
    var s = document.createElement('div');
    s.id = 'chatrix_init_widget'; 
    s.style = 'position: fixed; z-index:101010; '+p+': 0; '+vp+': 0; height:'+h+'px; width: '+dw+'px';
    var ss = document.getElementsByTagName('body')[0].appendChild(s);
    var i = document.createElement('iframe');
    i.className = 'chatrix_iframe_container';
    i.height = '100%';
    i.width = '100%';
    i.src = '//danialart.biz/chatrix/widget.php?c='+client_id;
    var ss = document.getElementById('chatrix_init_widget').appendChild(i);
}
function s() {
    var s = document.createElement('script');
    s.type = 'text/javascript'; 
    s.src = '//danialart.biz/chatrix/js/client_side.js';
    var ss = document.getElementsByTagName('body')[0].appendChild(s);
}
if(d.readyState=='complete'){
    l();
    s();
}else{
    if(w.attachEvent){
        w.attachEvent('onload',l);
        s();
}else{
    w.addEventListener('load',l,false); s();}}})();
In function named s() i create script tag which connect remote jquery file functions, but nothing in this file (execlude consolel.log command) is work. Not click, or other jquery action not work at all.