Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- ======================= custom.js==================== -->
- (function($) {
- $('.input-text').on("change", function () {
- //get the selected value
- var selectedValue = $(this).val();
- $('.fuck').text( selectedValue );
- // alert($(this).val());
- //make the ajax call
- $.ajax({
- url: "testos.php",
- type: "POST",
- data: {url : selectedValue},
- success: function(){
- alert('success');
- },
- error: function(){
- alert('error !');
- }
- });
- });
- })(jQuery);
- <!-- ======================= testos.php ==================== -->
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Document</title>
- </head>
- <body>
- <?php
- $display_data = isset( $_POST['url'] ) ? $_POST['url'] : '';
- echo $display_data;
- var_dump($display_data);
- ?>
- <form action="" method="post">
- <input type="text" class="input-text" name="inputtxt" placeholder="Input Your Text">
- </form>
- <script src="jquery-1.11.1.js"></script>
- <script src="custom.js"></script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment