var a = 'abc'; var abc = 'client'; var av = 'talker'; var r = '?r='+(200+133); var __PRE_URL =''; var tt = document.getElementById('_smarttalk'); if(tt) { var t = tt.getAttribute('src'); if(t.match(/http/i)) { var t2 = t.split(/\//i); __PRE_URL = 'http://'+t2[2]; } } function loadjs(file) { if(__PRE_URL!='') { file = __PRE_URL+file; } var js_file = document.createElement('script') js_file.setAttribute('type', 'text/javascript') js_file.setAttribute('src', file) // append new script file to the "head" container document.getElementsByTagName('head')[0].appendChild(js_file); } loadjs('/smarttalk/'+av+'/'+abc+'/'+r);