• 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

find in set in laravel ? example

Generate random username based on full name php

Passing PHP JSON to Javascript: echo json_encode vs echo json declaration

Limit login attempts in Laravel 5.7

How can I make a full text index of the column?

Converting array to string and then back in PHP

Respond with status code 401 on authentication failure using Laravel and Passport?

str_replace or preg_replace random number from string

How to change product Image when variables are selected in Shop and Archive Pages?

Fatal error: Uncaught Error: Call to undefined method mysqli_stmt::fetch_assoc() [duplicate]

Object of class stdClass could not be converted to string error

How can I access an array/object?

SendGrid: Sending an email to multiple recipients without other emails being shown on the "to" field

Laravel SQL query midnight time not showing

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

About Contact Privacy policy Terms and conditions