• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

How to get AJAX to post on second page?

javascriptphpjqueryajax


PHP Snippet 1:

$( document ).ready(function() {

$("button").click(function() {
var dataPoint = "chunk of data";
    ///////// AJAX //////// AJAX //////////
        $.ajax({
            type: 'POST',
            url:  'some_page_name.php',
            data: {dataPoint:dataPoint},
            success: function( response ){
                $('#success').html("Sent!!");
            }
        });
    ///////// AJAX //////// AJAX /////////

  });

PHP Snippet 2:

<button>Click me</button>
<div id="success"></div>

Related Snippets

How can I stop a symfony process which is listening on http://127.0.0.1:8000

How can I format this number correctly using PHP?

Distribute array row data to make multiple new rows

wordpress : How to specify the cause "This site can’t be reached"

str_word_count() function doesn't display Arabic language properly

CodeIgniter extend CI_URI undefined method

I want a way to give path to my files which are outside of public folder in laravel

mysql slow on updates for a well optimized query

Why do I have invalid argument supply for foreach in Laravel for json response? [duplicate]

Adding one microsecond to Datetime object in PHP

How to fix bootstrap multiselect search data using ajax

PHP SoapClient: set a namespace without prefix

error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure

Display the WooCommerce product price inside a custom function

How to add automatically collapse/expand in content wordpress (single.php)?

About Contact Privacy policy Terms and conditions