India Mutual Fund Market Size (2024)

"> // `; codeToEmbed.innerText = `

`}// Citation Copy const citationText = document.querySelector(".citation-text"); const copyCitation = document.querySelector("#copy-citation"); copyCitation.addEventListener("click", function (event) { event.preventDefault(); handleShare('Citation Copied'); var copyText = citationText.innerText; navigator.clipboard.writeText(copyText); let copiedNotification = document.getElementById("citation-copy-notification"); copiedNotification.classList.remove("invisible"); setTimeout(()=>copiedNotification.classList.add("invisible"), 2000); });// Link Copy const copyButton = document.querySelector("#copy-link"); copyButton.addEventListener("click", function (event) { event.preventDefault(); handleShare('Link Copied') navigator.clipboard.writeText(`${report_url}`); let copiedNotification = document.getElementById("link-copy-notification"); copiedNotification.classList.remove("invisible"); setTimeout(()=>copiedNotification.classList.add("invisible"), 1500 ); });// Embed Code Copy const copyEmbedCodeButton = document.getElementById('copy-embed-code-butt'); copyEmbedCodeButton.addEventListener("click", function(event){ event.preventDefault(); handleEmbedSnapshot(); let copyiedCode = document.getElementById('code-to-copy').innerText; navigator.clipboard.writeText(copyiedCode); let codeCopiedNotification = document.getElementById("embed-code-copy-notification"); codeCopiedNotification.classList.remove("invisible"); setTimeout(()=>codeCopiedNotification.classList.add("invisible"), 1500 ); });// Facebook Share let facebookShare = document.getElementById("facebook-share"); facebookShare.addEventListener('click', function() { handleShare('Facebook'); let url = `https://www.facebook.com/sharer/sharer.php?u=${encodeURI(report_url)}`; window.open(url,'Share on Facebook', `width=${width}, height=${height}, top=${top}, left=${left}`) }); // LinkedIn Share let linkedinShare = document.getElementById("linkedin-share"); linkedinShare.addEventListener('click', function() { handleShare('LinkedIn'); let url = `https://www.linkedin.com/shareArticle?mini=true&url=${encodeURI(report_url)}&source=MordorIntel`; window.open(url, 'Share on Linkedin', `width=${width}, height=${height}, top=${top}, left=${left}`); }); // Twitter Share let twitterShare = document.getElementById("twitter-share"); twitterShare.addEventListener('click', function() { handleShare('Twitter'); let url = `http://twitter.com/intent/tweet?url=${encodeURI(report_url)}&text=${encodeURIComponent(reportTitle)},${encodeURIComponent('@MordorIntel')}&hashtags=mordorintelligence,${slug.replaceAll("-", "")}`; window.open(url, 'Share on Twitter', `width=${width}, height=${height}, top=${top}, left=${left}`); }); // Email Share let emailShare = document.getElementById("email-share"); emailShare.href = `mailto:?subject=${encodeURIComponent("Mordor Intelligence - " + shortTitle)}&body=${encodeURIComponent('Check out this report from Mordor Intelligence. I believe you will find it interesting.')}%0D%0A%0D%0A${encodeURIComponent(metaDescription)}%0D%0A%0D%0A${encodeURIComponent(marketSnapshotUrl)}%0D%0A%0D%0A${encodeURIComponent(report_url)}`; emailShare.addEventListener('click', function() { handleShare('Email'); }); // Share Analytics async function handleShare(type=null){ try{ let body ={ reportTitle: `${reportTitle}`, reportSlug: `${slug}`, reportUrl: `${report_url}`, sharingPlatform: type, } fetch(`${backend_url}/api/collect-analytics/share-analytics`, { method: 'post', body: JSON.stringify(body) }).then(res=>{ console.log('Send Successfully'); }) } catch(error){ console.log(`Error at Share Analytics: ${error}`); } }// Embed Analytics async function handleEmbedSnapshot(){ try{ let body ={ image: (imageType === "executive-summary") ? marketSnapshotUrl.split('/')[3]+'-executive-summary-snapshot' : marketSnapshotUrl.split('/')[3]+'-market-snapshot', imageUrl: marketSnapshotUrl, reportTitle: `${reportTitle}`, reportSlug: `${slug}`, reportUrl: `'${report_url}`, isMarketSnapshot: isMarketSnapshot, isExecutiveSummary: isExecutiveSummary, } fetch(`${backend_url}/api/collect-analytics/embed-analytics`, { method: 'post', body: JSON.stringify(body) }).then(res=>{ console.log('Send Successfully'); }) } catch(error){ console.log(`Error at Embed Snapshot Analytics: ${error}`); } }// Alter Image Url function alterImageUrl(imageUrl){ if(window.location.href?.includes('www.mordorintelligence.com')){ if(imageUrl?.includes('mordorlabs')){ imageUrl = imageUrl.replace('mordorlabs','mordorintelligence'); }else if(imageUrl?.includes('mordor-graph-bucket.s3.us-west-2.amazonaws')){ imageUrl = imageUrl.replace('mordor-graph-bucket.s3.us-west-2.amazonaws','s3.mordorintelligence'); } }else{ if(imageUrl?.includes('mordorintelligence')) { imageUrl = imageUrl.replace('mordorintelligence','mordorlabs'); }else if(imageUrl?.includes('mordor-graph-bucket.s3.us-west-2.amazonaws')){ imageUrl = imageUrl.replace('mordor-graph-bucket.s3.us-west-2.amazonaws','s3.mordorlabs'); } } return imageUrl + "?embed=true"; }}

Want to use this image?

Please copy & paste this embed code onto your site:

Images must be attributed to Mordor Intelligence. Learn more

About The Embed Code X

Mordor Intelligence's images may only be used with attribution back to Mordor Intelligence. Using the Mordor Intelligence's embed code renders the image with an attribution line that satisfies this requirement.

In addition, by using the embed code, you reduce the load on your web server, because the image will be hosted on the same worldwide content delivery network Mordor Intelligence uses instead of your web server.

Code Copied!

As someone deeply immersed in the realm of web development, particularly in the context of sharing and embedding content, I bring forth my expertise to unravel the intricacies embedded in the provided code snippet. Let's delve into the various concepts and functionalities encapsulated in this JavaScript code.

  1. Event Listeners: The code begins by setting up event listeners for various actions, such as copying citations, copying links, and copying embed codes. These listeners respond to user interactions like clicks and trigger corresponding functions.

  2. Clipboard Interaction: The navigator.clipboard.writeText() method is employed to write text to the clipboard. This is crucial for enabling users to easily copy and share information from the webpage.

  3. Share Functionality: The code facilitates sharing on different platforms—Facebook, LinkedIn, Twitter, and Email. It constructs shareable URLs with appropriate parameters and opens new windows for sharing on the respective social media platforms.

  4. Analytics Tracking: The script includes asynchronous functions (handleShare and handleEmbedSnapshot) responsible for tracking user interactions. These functions send analytics data, such as the report title, URL, and the sharing platform used, to a backend server.

  5. URL Manipulation: The encodeURI() and encodeURIComponent() functions are utilized to ensure proper encoding of URLs and text before using them in the constructed shareable links.

  6. Dynamic Image URL Alteration: The alterImageUrl function dynamically modifies image URLs based on the current website's domain. This is particularly useful for handling image sources from different environments, ensuring consistency.

  7. Embed Code Presentation: The script generates embed codes for users to share content on their websites. This is facilitated by updating the inner text of HTML elements with the generated code.

  8. Notification Handling: Notifications are displayed to the user to indicate successful actions, such as copying citations, links, and embed codes. These notifications are set to disappear after a short interval (setTimeout function).

In conclusion, this JavaScript code orchestrates a seamless sharing and embedding experience for users, incorporating clipboard interaction, social media sharing, analytics tracking, and dynamic URL manipulation. It exemplifies a well-crafted integration of functionality and user interface in the context of content dissemination on the web.

India Mutual Fund Market Size (2024)
Top Articles
Latest Posts
Article information

Author: Jamar Nader

Last Updated:

Views: 6455

Rating: 4.4 / 5 (55 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Jamar Nader

Birthday: 1995-02-28

Address: Apt. 536 6162 Reichel Greens, Port Zackaryside, CT 22682-9804

Phone: +9958384818317

Job: IT Representative

Hobby: Scrapbooking, Hiking, Hunting, Kite flying, Blacksmithing, Video gaming, Foraging

Introduction: My name is Jamar Nader, I am a fine, shiny, colorful, bright, nice, perfect, curious person who loves writing and wants to share my knowledge and understanding with you.