Share post and page using ajax or static path

Use below code to add button using ajax or static link from codding to share your post on social site.