1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>Input Your website</title>
- <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
- <style>
- .css-input { margin-bottom: 0; text-shadow:0px 0px 0px rgba(42,42,42,.75); text-align:left; border-radius:8px; border-width:3px; border-style:solid; background-color:#ffffff; border-color:#419fd1; box-shadow: -7px 0px 10px 0px rgba(7,76,214,.0); font-weight:normal; font-family:sans-serif; font-size:16px;width:500px }
- .css-input:focus { outline:none; }
- .btn {
- display: inline-block;
- padding: 6px 12px;
- margin-bottom: 0;
- font-size: 14px;
- font-weight: 400;
- line-height: 1.42857143;
- text-align: center;
- white-space: nowrap;
- vertical-align: middle;
- -ms-touch-action: manipulation;
- touch-action: manipulation;
- cursor: pointer;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- background-image: none;
- border: 1px solid transparent;
- border-radius: 4px;
- color: #fff;
- background-color: #337ab7;
- border-color: #2e6da4;
- margin-left: 10px;
- }
- </style>
- <script type="text/javascript">
- $(document).ready(function () {
- $("#button").click(function () {
- if($("#url").val() == '') return false;
- $.ajax({
- //cache: true,
- type: "POST",
- url: 'u2s.php',//提交的URL
- data: $('#shorturl').serialize(), // 要提交的表单,必须使用name属性
- //async: false,
- success: function (data) {
- $("#result").html(data);//输出提交的表表单
- },
- error: function (request) {
- alert("Connection error");
- }
- });
- return false;
- });
- });
- </script>
- </head>
- <body>
- <h2>请输入需要转换的网址</h2>
- <form id="shorturl" action method="POST">
- <input type="text" id="url" name="url" class="css-input" ><button class="btn" id="button">提交</button>
- </form>
- <div id="result"></div>
- </body>
- </html>
|