How to Get Base URL Using jQuery

This blog all about how to get the base URL using jQuery. For example, if the total URL is http://192.168.1.147:8080/sign/

The output will be http://192.168.1.147:8080 . Here base URL can be obtained by simply using jquery attr() in-built method by passing the parameter “origin”, Find the below code to get the base URL for a page.

Get Current URL Using jQuery

Dynamic Load Jquery Datepicker

Datepicker is very widely used in web technology. Especially Jquery date picker is very good and easy to use in websites or web applications. Its very simple when the input field Datepicker is in HTML files, But If It is dynamically loaded then we have to make it small changes, I will explain it below,

But Question is What is Dynamic loaded Jquery Datepicker and how the jquery date picker will be load Dynamically.

When you are adding Datepicker add more button or appending jquery Datepicker by Ajax, in that case, Simple Jquery Datepicker function will not work. In that case, we have to add  .on()  method attaches event handlers.

See the below examples:-