Category Archives: javascript

Remove duplicate objects from JSON file in javascript

By | December 12, 2019

So here is how we can remove the duplicate objects from json file using javascript, [ { “Id”: “12345”, “Name”: “Jatin” }, { “Id”: “12346”, “Name”: “Ajay” }, { “Id”: “12345”, “Name”: “Jatin” }, ] Now i need to remove duplicate records [whose id matches] from above json file, 1) we need to parse jsonā€¦ Read More »

anchor tag href value in jquery

By | November 25, 2019

while working on one project, we came across situation, were we want to read href value of anchor tag and url parameters value, <a href=”\details?name=jatin” class=”mainClass”>jatin nahar</a><br/> so we can read the href value anchor tag as below, $(document).ready(function() { $(“a.mainClass”).click(function( var name = $(this).attr(‘href’).split(‘=’); console.log([1]); }); });