HaniiPuppy

script.html

Oct 9th, 2017
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.96 KB | None | 0 0
  1. <!DOCTYPE html>
  2.  
  3. <html>
  4.     <body onLoad="runScript()">
  5.         <h1>TTS script</h1>
  6.        
  7.         <script type="text/javascript" src="jquery-3.2.1.min.js"></script>
  8.         <script type="text/javascript" src="haniilinkedlist_1.js"></script>
  9.         <script type="text/javascript">
  10.        
  11.             function runScript()
  12.             {
  13.                 var paramval = getURLParameter("q");
  14.                 var testList = new LinkedList();
  15.                
  16.                 document.getElementById('demo').innerHTML = testList.say("test text");
  17.                
  18.                 if(!paramval)
  19.                 {
  20.                     window.location.hash = "#queryparamnotparsed";
  21.                     return;
  22.                 }
  23.                
  24.                 window.location.hash = "#" + paramval;
  25.             }
  26.            
  27.             function getURLParameter(name)
  28.             {
  29.                 // From stackoverflow.com/questions/11582512
  30.                 var regex = new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)');
  31.                 return decodeURIComponent((regex.exec(location.search) || [null, ''])[1].replace(/\+/g, '%20')) || null;
  32.             }
  33.            
  34.         </script>
  35.        
  36.         <p id="demo"></p>
  37.     </body>
  38. </html>
Advertisement
Add Comment
Please, Sign In to add comment