Mission: To get a variable from the URL and use it to change text.
What does foo equal? Answer: none


A URL Param - Glen
A URL Param - Bill
A URL Param - Phil
A URL Param - None


Based on the URL, the text below gets replaced.
Default text



Include this in the page, make modifications based on what params are there. SCRIPT <script src='http://code.jquery.com/jquery-latest.js' type='text/javascript'></script> <script src='http://www.mathias-bank.de/jQuery/jquery.getUrlParam.js' type='text/javascript'></script> <script type="text/javascript"> $(document).ready(function(){ var someUrlVar = $(document).getUrlParam("foo"); $(".fooDiv span").text(someUrlVar); switch (someUrlVar) { case 'Glen': $(".replaceText div").empty().text("Glen is the best"); break; case 'Bill': $(".replaceText div").empty().text("Bill Says Hello!"); break; case 'Phil': $(".replaceText div").empty().text("Our fearless leader!"); break; default: $(".replaceText div").empty().text("This is the default in the switch"); } }); </script> HTML: <div class="replaceText"> Based on the URL, the text below gets replaced.<br /> <div style="font-weight: bold;">Default text</div> </div>