• 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

JQuery content editable div and text box on submit not sending POST

javascriptphpjqueryhtmltext-editor


PHP Snippet 1:

$(document).ready(function() {
    $("#save").on("click", function(event) {
        var formData = {text: $("#editor").html(), name: $("#name").val()};
        event.preventDefault();
        $.ajax({
            url: 'freewordsave.php',
            type:'POST',
            data: formData,
            success: function(msg)
            {
                alert('Your file was saved!');
            }
        });
    });
});

Related Snippets

Navigation idle on content download

Is there a way to correctly use sanitize_text_field and wp_unslash that doesn't cause psalm to error with "expects string, possibly different type"

Pass an image through AJAX [duplicate]

Batch request Google Calendar php API

Docker & Laravel : configure: error: Package requirements (oniguruma) were not met

Unable to create lockable file - Laravel 8 & PHP 8

How to get median and quartiles/percentiles of an array in JavaScript (or PHP)?

How to submit a form when page loads using JavaScript?

How to submit the custom form data in database in WordPress without plugin using ajax?

PHP file_get_contents function

Using PHP to connect to a remote MSSQL database

Update Order custom Field value with WooCommerce REST API

LARAVEL: How to fetch id dynamically in a query builder?

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

PHP array slice from position + attempt to return fixed number of items

About Contact Privacy policy Terms and conditions