jquery = $
jquery.load('text.html')
is the same as $.load('text.html')
Javascript:
1document.getElementById('#jumbo')
jQuery:
1$('#jumbo')
Javascript:
1document.getElementById('#load').style.display = 'none';
jQuery:
1$('#load').hide();
Javascript:
1var text = "hello there!"
2document.getElementById('#page').innerHTML = text;
jQuery:
1var text = "hello there!"
2$('#page').html(text);
Javascript:
1for (i = 0, i < items.length, i++) {};
jQuery:
1$.each(array, function(i, item)){};
Javascript:
1xhr = new XMLHttpRequest ();
2xhr.onreadystatechange = function () {
3 if (xhr.readyState === 4) {
4 if (xhr.status === 200) {
5 document.getElementById('#ajax').innerHTML = xhr.responseText;
6 }
7 }
8};
9xhr.open('GET','sidebar.html');
10xhr.send();
jQuery:
1$('#ajax').load('sidebar.html');