Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9199911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:38:48+00:00 2026-06-17T22:38:48+00:00

I am sending my entire page html back to server using jquery ajax post

  • 0

I am sending my entire page html back to server using jquery ajax post
My code is like this

    $(document).ready(function () {

    var pcontent = document.body.innerHTML;

    var url = new URI().addQuery("pcontent", pcontent);

    $.ajax({
        url: url, type: "POST"
      , success: function (data) {

          alert(data.html());
      },
        complete: function () {
            alert(1);
        },
        error: function (jqXHR, error, errorThrown) {
            if (jqXHR.status) {
                alert(jqXHR.responseText);
            } else {
                alert("Something went wrong");
            }
        }
    });
    return false;
});

but the code makes an error like this

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">

<HTML><HEAD><TITLE>Request URL Too Long</TITLE>

<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>

<BODY><h2>Request URL Too Long</h2>

<hr><p>HTTP Error 414. The request URL is too long.</p>

</BODY></HTML>

as far as i understood i cant send entire page html through an ajax post.Is it true? or is there any thing else that makes this error for me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T22:38:50+00:00Added an answer on June 17, 2026 at 10:38 pm

    The are limitation on number of characters in the URL. You can have max 2000 characters in your URL.
    Don’t send your html in URL, instead use “data” parameter of jquery ajax.
    Something like

    $.ajax({
            url: url, type: "POST", data: {pcontent: $(pcontent).serialize()}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In My page i am sending data to server side using 8 ajax call...
I sending ajax request from a jQuery file like below, which expects response in
Sending XML from C# Server and receiving it it in Android Java client This
Im sending (with ASIFormDataRequest) a POST request, with 4 parameters. The server launches a
When sending data via POST or GET with jQuery you use for format {
I am sending post data to saveworld.php and getting some result in that page
I have a page which basically loads using ajax, but I want to switch
sending mail along with embedded image using asp.net I have already used following but
Sending Email in Android using JavaMail API without using the default/built-in app I'm trying
When sending uncontrolled amounts of TextWebSocketFrames to a simple Netty WebSocket echo server implementation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.