Skip to main content

Posts

Showing posts from March, 2019

How to make a Table with search and filter functionality dynamically using jQuery?

<html lang="en"> <head> <title>Table for Learning</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <style> th,td,tr{border: 1px solid #0000ff; text-align: center; border-collapse: collapse;} table{ border: 1px solid orange; border-collapse: collapse; text-align: left; } tr:hover{ color: green; } </style> </head> <body> <h1>Data From Server</h1> <input type="text" id="search" placeholder="search here.."> <select name="" id="onSelect"></select> <table id='mn'> <thead> <tr> <th>Id</th> <th>Name</th> <th>User Name</th> <th>Email</th> ...

How do I redirect to another web page ?

How to go to another webpage ? Sol: If you want to open an webpage then you should use   window.location.href="http://rajparam.blogspot.com"          *It is better for clicking a link or a button. OR window.location.replace("http://rajparam.blogspot.com")         *It isbehave as HTTP redirect. OR window.location=open("http://rajparam.blogspot.com")            *It opens a webpage in new Tab

How to remove %20 from your string or How to decode your text from a variable like "Hurrah%21%20We%20have%20won%20the%20match" using java Script or jQuery?.

So Guys You Need to remove the %20 like unknown codes. Sol: 1) I f you want to remove %20 from a text like "I%20am%20a%20Student." only then you should use var txt ="I%20am%20a%20Student." var str = txt.replace(/%20/g," ")     console.log(str); Output: I am a Student.            OR simply, You can use decodeURI(txt)  OR  decodeURIComponent(txt)   OR   unescape(txt) 2) I f you want to remove %20, %2E etc from a text like "Hurrah%21%20We%20have%20won%20the%20match%2E"  then you should use var str ="Hurrah%21%20We%20have%20won%20the%20match%2E"  unescape(txt)  ** OR   decodeURI(txt)  OR  decodeURIComponent(txt) **You Should avoid use of unescape() as it was d eprecated in JavaScript version 1.5. Thanks for reading comment here below if you liked it.