Skip to main content

Posts

How to Select/Check all radio buttons using Jquery

Use below HTML code to Check all radio buttons <input type="radio" class="presnt_all" name="emp_attendance" id="emp_attendance" value="1"/>All Present <input type="radio" class="absent_all" name="emp_attendance" id="emp_attendance" value="2"/>All Absent <input type="radio" class="leave_all" name="emp_attendance" id="emp_attendance" value="3"/>All Leave <input type="radio" class="presnt_att" name="emp_attendance1" id="emp_attendance1" value="1" />Present <input type="radio" class="absent_att" name="emp_attendance1" id="emp_attendance1" value="2" />Absent <input type="radio" class="leave_att" name="emp_attendance1" id="emp_attendance1" value="3" />Leave

Remove www & force https from URL using htaccess

By Using below code we are able to remove www and force https from URL using htacces   RewriteEngine On   RewriteCond %{HTTP_HOST} ^www.greenrobot.com$ [NC] RewriteRule ^(.*)$ https://greenrobot.com/$1 [R=301,L]   RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]   Or   <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ https://%1/$1 [R=301,L] RewriteCond %{HTTPS} !=on RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] </IfModule>

Split a string and get last match in jQuery and Javascript

Method 1: str = "~test content ~thanks ok ~eabhyas.blogspot.com";    strFine =str.substring(str.lastIndexOf('~')); console.log(strFine ); Output: ~eabhyas.blogspot.com Method 2: str = "~test content ~thanks ok ~eabhyas.blogspot.com";    console.log(str.split('~').pop()); OR str = "~test content ~thanks ok ~eabhyas.blogspot.com";  var parts = str.split("~"); var what_you_want = parts.pop(); Output: eabhyas.blogspot.com Method 3: str = "~test content ~thanks ok ~eabhyas.blogspot.com";    arr = str.split('~'); strFile = arr[arr.length-1]; console.log(strFile ); Output: eabhyas.blogspot.com