RcBuilder@walla.com
call centre: 054-5614020

jQuery Counters – count page elements

Posted by: RcBuilder  /   Category: a / body / children / div / each / HTML / JAVASCRIPT / jQuery / not / size / span / tagName   /   No Comments
20
Oct
2014

jQuery Counters - count page elements html <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript" src="jquery-1.5.2.min.js"></script> </head> <body> <a limited="1">LINK</a>&nbsp;&nbsp;|&nbsp;&nbsp; <a>LINK</a>&nbsp;&nbsp;|&nbsp;&nbsp; <a limited="1">LINK</a>&nbsp;&nbsp;|&nbsp;&nbsp; <a>LINK</a>&nbsp;&nbsp;|&nbsp;&nbsp; <a limited="1">LINK</a>&nbsp;&nbsp;|&nbsp;&nbsp; <a limited="0">LINK</a>&nbsp;&nbsp;|&nbsp;&nbsp; <a limited="1">LINK</a> <br /><br /> <span>SPAN</span>&nbsp;&nbsp;|&nbsp;&nbsp; <span limited="1">SPAN</span>&nbsp;&nbsp;|&nbsp;&nbsp; <span limited="1">SPAN</span>&nbsp;&nbsp;|&nbsp;&nbsp; <span>SPAN</span> </body> </html> counters // 14 (all elements within the body element) alert($('body').children('*').size()); // 18 (all tags including head, script etc.) alert($('*').size()); // 7 (all non link elements within the body element) alert($('body').children('*').not('a').size()); using $('body').children('*').each(function () { alert(this.tagName);.

Read more

jQuery ajax – status codes, json and http methods PUT POST GET DELETE

Posted by: RcBuilder  /   Category: AJAX / each / JAVASCRIPT / jQuery / JSON / Request   /   No Comments
12
Oct
2014

jQuery ajax - status codes, json and http methods PUT POST GET DELETE USING JSON $.ajax({ type: 'POST', url: '/api/users', // dataType: 'json', data: { Id: 145, FirstName: 'Roby', LastName: '2222', Age: 32 }, success: function (data) { $('<div>' + data.FirstName + '</div>').appendTo('#divUsers'); }, error: function (xhr) { alert('STATUS = ' + xhr.status); } }); USING STATUS CODES $.ajax({ type: 'POST', url: '/api/users', dataType: 'json', data: { Id: 145, FirstName: 'Roby', LastName: '2222', Age:.

Read more
  • פיתוח מערכות
  • פתרונות טכנולוגים
  • קידום אתרים
  • בניית אתרים