JQUERY IN .NET

Posted on Updated on

Image result for jquery logoJQUERY IN .NET

With jQuery 3.0 we can use ES6 for…of, so the same loop will be:

varmy Rows = $(‘.row’);

for(let row of rows) {

// my code

};

EscapeSelector

JQuery 3.0 give us the new $.escapeSelector (). The technique permits to escape characters that have an alternate use as CSS selector, and result in a wrong choice.

Beginning from this basic HTML code: 

<body>

 

 

 </body>

Calling the selector given beneath, the component is not chose, in light of the fact that unique characters must be gotten away:

 $(‘#my:terrible.id’);

 With jQuery 3.0 it can be chosen this way

 $(‘#’+$.escapeSelector(‘my:terrible.id’));

This strategy is especially valuable when a class name or an ID contains characters that have an exceptional importance in CSS, for example, the dab or semicolon. Such characters more often than not happen in legacy applications or auto-created code. Presently as opposed to utilizing getting away capacities, we have the jQuery official one.

 XSS assault security

JQuery 3.0 included an additional security layer for insurance against Cross-Site Scripting (XSS) assaults. 

From MDN (https://developer.mozilla.org/it/docs/Glossary/Cross-site_scripting): 

Cross-webpage scripting (XSS) is a security adventure which permits an assailant to infuse into a site pernicious customer side code. This code is executed by the casualties and gives the assailants a chance to sidestep get to controls and imitate clients. As indicated by the Open Web Application Security Project, XSS was the third most normal Web application powerlessness in 2013.

This new layer requires the designers to indicate data Type: “script” in the alternatives of $.Ajax () and $.get () techniques. Presently when you make a demand for a script on a space not quite the same as yours, you should now unequivocally pronounce this in the choices. 

get() and post() signature changes 

JQueryget () and post () are shorthand for the Ajax () work utilized regularly to improve an Ajax call. In jQuery 1.0, the Ajax () capacity can get an arrangement of key/esteem combines that design the Ajax ask. This was impractical with get () and post (). 

JQuery 3.0 includes this mark for the $.get ( ) and the $.post ( ) so as to adjust them to $.Ajax ( ). Clearly the sort choice will be overlooked and set in like manner from the shorthand capacity. 

Extremely negligible SVG bolster 

JQuery has never completely bolstered SVG and most likely this will never show signs of change. With jQuery 3.0 techniques for CSS class control, .add Class (), .remove Class () and .has Class () can now be utilized to control SVG. 

Preceding jQuery 3.0 you needed to get to class quality as whatever other property, losing the force of jQuery class control capacities. 

Presently jQuery can be utilized to discover a SVG component and style the classes with CSS. 

Beginning from this basic HTML code:

<svgwidth=”200px”height=”200px”viewBox=”0 0 200 200″>

<rectclass=”myRect”x=”10″y=”10″width=”40″height=”50″/>

</svg>

..to add a class named power to the rect element you have to use:

varmyRect = $(‘.myRect’);

// This is a very simple addClass…

myRect.attr(‘class’, ‘myRect power’);

With jQuery 3.0 we can finally manipulate SVG element class:

varmyRect = $(‘.myRect’);

myRect.addClass(‘power’);

 

Decimal values by width and height

Before jQuery 3, the jQuery library returned rounded int values with width (), height () and related methods. JQuery 3 now return a floating number; this is particularly relevant when you have to work with exact values on layout and DOM manipulation.

Starting from this simple HTML code:

<body>

</body>

..calling the following code, the result will be My width is: 13:

varmy Width=$(‘#row’).width();

alert(‘My width is ‘+my Width);

 

*****************************************************************************************************

For more details and queries please feel free to email, visit or call us. Wishing you the very best for all your future endeavors.
Helpline: 9814666333, 8699444666
Email: info@technocampus.co.in

Please fill the form and we shall contact you soon.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s