adsense

Saturday, January 30, 2021

Reset Linkedin link preview cache

 If you have shared your website or an article in LinkedIn and then you decided to change the link preview data then you will see that LinkedIn still displaying old content. This happens as e LinkedIn caches link preview data  for 7 days.

We can resolve this using the LinkedIn Post Inspector. Follow these steps to claerLinkedin link preview cache.

  1. Navigate tohttps://www.linkedin.com/post-inspector/
  2. Input your URL and click on Inspect. preview image will be updated
  3. Retry to share your URL on LinkedIn


 Cheers

Samitha


Tuesday, January 12, 2021

Textbox format number with two decimal places

 There can be many ways to display a number formatted in a textbox. Here I have used jQuery to achieve the expected result.


<script>

$(function () {

    $('#txtAmount').on('input', function(e) {

        if (/^(\d+(\.\d{0,2})?)?$/.test($(this).val())) {

            $(this).data('oldValue', $(this).val());

        } else {

            $(this).val($(this).data('oldValue') || '');

        }

    }).trigger('input');  

});

</script>

HTML

<input type="text"  id="txtAmount" placeholder="Enter Amount" />


Cheers

Samitha