Russian popular JavaScript ScriptJava Framework

http://scriptjava.net/source/scriptjava/scriptjava.js

http://translate.google.ru/translate...iptjava.net%2F

http://scriptjava.net/documentation

How it work

-----------------------------
version scriptjava

Code:
alert($ver);
Code:
if($ver>20111101) {
//code
}
-----------------------------

Runs when the document is loaded

Code:
$$r(function() {
//code
});
-----------------------------

Code:
$$('result').$$('text');
or

Code:
$$('result','text');
= =

Code:
document.getElementById('result').innerHTML='text';
-----------------------------

Code:
$$('result').$$('color','#ff0000');
or

Code:
$$('result','color','#ff0000');
= =

Code:
document.getElementById('result').color='#ff0000';
-----------------------------

Code:
$$().body
= =

Code:
document.body
-----------------------------

Code:
$$('result').$$('text').$$('color','#ff0000');
or

Code:
$$('result','text').$$('color','#ff0000');
or

Code:
$$('result','color','#ff0000').$$('text');
or

Code:
$$('result').$$('color','#ff0000').$$('text');
= =

Code:
document.getElementById('result').innerHTML='text';
document.getElementById('result').color='#ff0000';
-----------------------------

Code:
$$($$($$($$($$($$($$('result')))))))
= =

Code:
$$('result')
= =

Code:
document.getElementById('result')
-----------------------------

Code:
document.getElementById('result').innerHTML='text';
document.getElementById('result').color='#ff0000';
document.getElementById('result_x').innerHTML='textxxxxx';
document.getElementById('result_x').color='#ffff00';
= =

Code:
$$('result').$$('color','#ff0000').$$('text').$$().$$('result_x').$$('color','#ffff00').$$('textxxxxx');
or

Code:
$$('result').$$('color','#ff0000').$$('text');
$$('result_x').$$('color','#ffff00').$$('textxxxxx');
or

Code:
$$('result','color','#ff0000').$$('text').$$().$$('result_x','color','#ffff00').$$('textxxxxx');
-----------------------------

AJAX POST GET HEAD

Code:
$$a({
  type:'get',//get,post or head
  url:'ajax.php',//url
  data:{'q':'1','z':'2'},//parameters
  response:'text',//text or xml
  header:{//if response:'xml'
    'Content-Type':'application/x-www-form-urlencoded; charset=windows-1251',
    'Referer':location.href
  },
  async:true,
  username:'',
  password:'',
  errrep:true,
  error:function(num) {
    var arr=['Your browser does not support Ajax',
      'Request failed',
      'Address does not exist',
      'The waiting time left'];
    
    alert(arr[num]);
  },
  status:function (number) {
    //alert(number);
  },
  endstatus:function (number) {
    //alert(number);
  },
  success:function (data) {
    //alert(data);
  },
  timeout:5000
});
------------------------------------------------

example

Code:
<script type="text/javascript" src="http://scriptjava.net/source/scriptjava/scriptjava.js"></script>
<script type="text/javascript">
$$r(function() {
	$$i({
		create:'script',
		attribute: {
			'type':'text/javascript',
			'src':'http://nagon.net/modules/NRMSLib/NRMSLib.js'
		},
		insert:$$().body,
		onready:function() {
			$$e.add($$('mp3button'),'click',playmp3rand);//add event
		}
	});
});

var playmp3rand = function (event) {
	modules.sound.stop();//stop if something is already playing
	switch($$s.randnum(1,3)) {//a random number from 1 to 3 inclusive
		case 1:
			modules.sound.start({'music': 'http://goldenland.onfind.net/2/1/'+$$s.randnum(1,8)+'.mp3'});
		break;
		case 2:
			modules.sound.start({'music': 'http://goldenland.onfind.net/2/2/'+$$s.randnum(1,12)+'.mp3'});
		break;
		case 3:
			modules.sound.start({'music': 'http://goldenland.onfind.net/2/3/'+$$s.randnum(1,4)+'.mp3'});
		break;
	}
	$$('sound_s_el_m').$$('width','1px').$$('height','1px').$$('overflow','hidden');//do not change
}
</script>

<span id="mp3button" style="color:#ff0000; font-size:12px; text-decoration:underline; cursor:pointer;">Play random sound</span>
-----------------------------

http://nagon.net/uploads/files/60/60-14djjprna.zip
http://nagon.net/uploads/files/58/58-5lxvnius6.zip
http://nagon.net/uploads/files/66/66-n7lwrtdlh.zip