Last active
August 29, 2015 14:19
-
-
Save LayneSmith/ec916d1fc2f8a4ed9fb9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //url formate should be ...index.html/?targetDiv | |
| $(document).ready(function () { | |
| //CHECK FOR VARIABLES IN URL | |
| var rawKeys = $(location).attr('search'); | |
| if (rawKeys) { | |
| console.log(rawKeys); //displays "?targetDiv" | |
| var strippedKey = rawKeys.substring(1); //get rid of question mark | |
| console.log(strippedKey); //displays "targetDiv" | |
| doStuff(strippedKey); //function call | |
| } | |
| }); | |
| //load this up with page manipulation | |
| function doStuff(targetDiv) { | |
| $("#" + targetDiv).show(); //should show target div | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment