Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>Scrolling DIV demo on iPhone / iPod Touch / Android / iPad</title>
- <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-1.0rc2.min.css" />
- <link href="ButtonStyles.css" rel="stylesheet" />
- <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
- <script src="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-1.0rc2.min.js"></script>
- <script src="Help.js" type="text/javascript"></script>
- <script type="text/javascript">
- $(document).ready(function(){
- $('#myButton').click(function(){
- var phrase = $('#myForm').val().replace(/\W+/, ' ');
- var words = phrase.split(/\s+/).filter(function(x) { return x.length; });
- for (var i = 0; i < words.length; ++i)
- {
- // alert(words[i]);
- if(words[i]=="We"||words[i]=="we"||words[i]=="WE")
- {
- $("#cnvalue").val("V");
- }
- else if(words[i]=="Are"||words[i]=="are"||words[i]=="ARE")
- {
- $("#cnvalue").val("R");
- }
- else if(words[i]=="Going"||words[i]=="going"||words[i]=="GOING")
- {
- $("#cnvalue").val("GNG");
- }
- else if(words[i]=="To"||words[i]=="to"||words[i]=="TO")
- {
- $("#cnvalue").val("2");
- }
- else if(words[i]=="Party"||words[i]=="party"||words[i]=="PARTY")
- {
- $("#cnvalue").val("PRTY");
- }
- else
- {
- $("#cnvalue").val("not clear");
- }
- }
- /*
- var data= $("#myForm").val();
- if(data=="We"||data=="we")
- {
- $("#cnvalue").val("V");
- }
- else if(data=="Are"||data=="are")
- {
- $("#cnvalue").val("R");
- }
- else if(data=="Going"||data=="going")
- {
- $("#cnvalue").val("GNG");
- }
- else if(data=="To"||data=="to")
- {
- $("#cnvalue").val("2");
- }
- else if(data=="Party"||data=="party")
- {
- $("#cnvalue").val("PRTY");
- }
- else
- {
- $("#cnvalue").val("not clear");
- }
- */
- //$("#cnvalue").val(data);
- });
- });
- </script>
- </head>
- <body>
- <div data-role="page" id="ui-page-start" class="ui-page ui-body-c ui-page-active">
- <div data-role="header">
- <h1>Dictionary</h1>
- </div>
- <div data-role="fieldcontain">
- <label for="name">Enter Text:</label>
- <input type="text" name="name" id="myForm" />
- </div>
- <button class="ui-btn-hidden" aria-disabled="false" id="myButton" >Convert Now </button>
- <div data-role="fieldcontain">
- <label for="name">Converted Value:</label>
- <input type="text" name="name" id="cnvalue" value="" />
- </div>
- <div data-role="footer" data-position="fixed">
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement