Advertisement
Guest User

Untitled

a guest
Nov 9th, 2011
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5.  
  6. <title>Scrolling DIV demo on iPhone / iPod Touch / Android / iPad</title>
  7. <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-1.0rc2.min.css" />
  8. <link href="ButtonStyles.css" rel="stylesheet" />
  9.  
  10. <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
  11. <script src="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-1.0rc2.min.js"></script>
  12. <script src="Help.js" type="text/javascript"></script>
  13. <script type="text/javascript">
  14.  
  15. $(document).ready(function(){
  16. $('#myButton').click(function(){
  17.  
  18.  
  19.  
  20. var phrase = $('#myForm').val().replace(/\W+/, ' ');
  21. var words = phrase.split(/\s+/).filter(function(x) { return x.length; });
  22. for (var i = 0; i < words.length; ++i)
  23. {
  24. // alert(words[i]);
  25. if(words[i]=="We"||words[i]=="we"||words[i]=="WE")
  26. {
  27. $("#cnvalue").val("V");
  28. }
  29. else if(words[i]=="Are"||words[i]=="are"||words[i]=="ARE")
  30. {
  31. $("#cnvalue").val("R");
  32. }
  33.  
  34. else if(words[i]=="Going"||words[i]=="going"||words[i]=="GOING")
  35. {
  36. $("#cnvalue").val("GNG");
  37. }
  38. else if(words[i]=="To"||words[i]=="to"||words[i]=="TO")
  39. {
  40. $("#cnvalue").val("2");
  41. }
  42. else if(words[i]=="Party"||words[i]=="party"||words[i]=="PARTY")
  43. {
  44. $("#cnvalue").val("PRTY");
  45. }
  46.  
  47. else
  48. {
  49. $("#cnvalue").val("not clear");
  50. }
  51.  
  52.  
  53.  
  54.  
  55. }
  56.  
  57.  
  58.  
  59.  
  60.  
  61. /*
  62.  
  63.  
  64.  
  65. var data= $("#myForm").val();
  66.  
  67.  
  68. if(data=="We"||data=="we")
  69. {
  70. $("#cnvalue").val("V");
  71. }
  72. else if(data=="Are"||data=="are")
  73. {
  74. $("#cnvalue").val("R");
  75. }
  76.  
  77. else if(data=="Going"||data=="going")
  78. {
  79. $("#cnvalue").val("GNG");
  80. }
  81. else if(data=="To"||data=="to")
  82. {
  83. $("#cnvalue").val("2");
  84. }
  85. else if(data=="Party"||data=="party")
  86. {
  87. $("#cnvalue").val("PRTY");
  88. }
  89.  
  90. else
  91. {
  92. $("#cnvalue").val("not clear");
  93. }
  94. */
  95.  
  96.  
  97. //$("#cnvalue").val(data);
  98.  
  99. });
  100. });
  101.  
  102.  
  103.  
  104.  
  105.  
  106. </script>
  107.  
  108.  
  109.  
  110. </head>
  111.  
  112. <body>
  113.  
  114.  
  115. <div data-role="page" id="ui-page-start" class="ui-page ui-body-c ui-page-active">
  116.  
  117.  
  118. <div data-role="header">
  119. <h1>Dictionary</h1>
  120. </div>
  121.  
  122. <div data-role="fieldcontain">
  123. <label for="name">Enter Text:</label>
  124. <input type="text" name="name" id="myForm" />
  125. </div>
  126.  
  127. <button class="ui-btn-hidden" aria-disabled="false" id="myButton" >Convert Now </button>
  128.  
  129. <div data-role="fieldcontain">
  130. <label for="name">Converted Value:</label>
  131. <input type="text" name="name" id="cnvalue" value="" />
  132. </div>
  133.  
  134.  
  135.  
  136. <div data-role="footer" data-position="fixed">
  137.  
  138. </div>
  139.  
  140.  
  141.  
  142.  
  143.  
  144. </div>
  145.  
  146.  
  147.  
  148.  
  149. </body>
  150. </html>
  151.  
  152.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement