<!DOCTYPE html><htmllang="en"><head><title>MPC Library outdated link landing page</title></head><br><divid="welcome-message"style="text-align: center;"><h2> Whoops, looks like you are using an outdated link!
</h2><p> The MPC Library has updated their off-campus access applications, please copy the updated link below. Contact <ahref="http://www.mpc.edu/library">the MPC Library</a> if you have any questions.
</p></div><divid="content-area"><!-- <p id="URLoutput"></p> --><divid="link-area"> The updated URL for this resources should be: <br></div></div><script>// Get the current URLvarcurrentURL=window.location.href;// Sanitize the URL to prevent JavaScript injection becausevarsanitizedURL=encodeURIComponent(currentURL);// Find the old proxy in the URL and replace it. Update with your old and new proxy prefixif(sanitizedURL.includes("libproxy.mpc.edu")){varnewURL=sanitizedURL.replace("libproxy.mpc.edu","mpc.idm.oclc.org");// Create a hyperlink element with the new URLvarhyperlinkdnewURL=document.createElement("a");hyperlinkdnewURL.href=decodeURIComponent(newURL);hyperlinkdnewURL.textContent=decodeURIComponent(newURL);// Append the hyperlink to the link-area divvarlinkArea=document.getElementById("link-area");if(linkArea){linkArea.appendChild(hyperlinkdnewURL);}// Create a button to copy the new URLvarcopyButton=document.createElement("button");copyButton.textContent="Copy updated link";copyButton.addEventListener("click",function(){// Copy the updated URL to the clipboardvartempTextarea=document.createElement("textarea");document.body.appendChild(tempTextarea);tempTextarea.value=decodeURIComponent(newURL);//alert(tempTextarea.value);tempTextarea.select();document.execCommand("copy");document.body.removeChild(tempTextarea);// Inform the user that the URL has been copiedalert("Updated link copied to clipboard!");});// Put the button on the pagevarcontentArea=document.getElementById("content-area");if(contentArea){contentArea.appendChild(copyButton);}}// Show the new URL in the URLoutput p of the html//document.getElementById("URLoutput").innerHTML = "The updated URL for this resources should be:<br>" + decodeURIComponent(newURL);</script></body></html>
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.