Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <body onLoad="runScript()">
- <h1>TTS script</h1>
- <script type="text/javascript" src="jquery-3.2.1.min.js">
- function runScript()
- {
- document.getElementById('demo').innerHTML = "done something";
- var paramval = getURLParameter("q");
- /*
- if(window.jQuery) { document.getElementById('demo').innerHTML = "jquery is enabled"; }
- else { document.getElementById('demo').innerHTML = "jquery is not enabled"; }
- */
- if(!paramval)
- {
- window.location.hash = "#queryparamnotparsed";
- return;
- }
- window.location.hash = "#" + paramval;
- }
- function getURLParameter(name)
- {
- // From stackoverflow.com/questions/11582512
- var regex = new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)');
- return decodeURIComponent((regex.exec(location.search) || [null, ''])[1].replace(/\+/g, '%20')) || null;
- }
- </script>
- <p id="demo"></p>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement