Skip to content

Instantly share code, notes, and snippets.

@MyCueCards
Last active February 13, 2019 15:09
Show Gist options
  • Save MyCueCards/317087bce31e759eb34b775c2114cb68 to your computer and use it in GitHub Desktop.
Save MyCueCards/317087bce31e759eb34b775c2114cb68 to your computer and use it in GitHub Desktop.
Using Bootstrap, this is JQuery that will open a modal if a specific line of text is found within the URL.
//Insert JQuery URL into header. Below is from Google.
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
//Place below code in body of page. It will open the modal by whatever ID is there when the page is ready.
$(document).ready(function(){
if(window.location.href.indexOf("sometexthere") > -1) {
$("#id").modal();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment