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 6210303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:08:11+00:00 2026-05-24T06:08:11+00:00

I have a simple table that is rendered in an MVC partial view and

  • 0

I have a simple table that is rendered in an MVC partial view and returned to the client via a jQuery ajax call.

Here’s what a simplified version of what the success callback looks like:

function (html, status, xhr)
{
 html = $(html); //Get html table as a jQuery object
 var tblClass = html.attr("class");
}

Now in IE9 I get get the table class no problem. In FF5 it fails. I debugged in Firebug and found that there is a “\r\n” before the <table> tag in the html string being returned. This isn’t really surprising because there is a blank line above the <table> tag in my partial view for readability.

When html = $(html); is run, instead of getting a jQuery object w/ a single table element in it I found that I have 2 elements in the jQuery object.

Element [0] shows up in FireBug as:

<TextNode textContent=";\n">

Element [1] is my table and this is causing the problem. What I would expect is what I’m getting in IE9 which is a jQuery object only containing a single element (the table). I don’t know why whitespace is being converted into <TextNode textContent=";\n">

Here’s my view:

@model IDataPage<EssenceNet.Domain.Transforms.EssenceResult>

<table class="csGrid">
    <tr>
        <th data-sort="Name" class='a' style="min-width:50px"><a></a>Name</th>
        <th data-sort="EssenceTypeID" style="min-width:50px"><a></a>Type</th>
        <th style="width:100%">Description</th>
    </tr>
    @foreach (var r in Model.Items)
    {
        <tr data-id="@r.EssenceID">
            <td style="color:#265E15">@r.Name</td>
            <td>@r.Type</td>
            <td>@r.Description.MaxLength(100)</td>
        </tr>
    }
    @Html.WritePagerRow(Model);
</table>

And here’s the ajax call (I’ve tried it several different ways) all w/ the same results:

$.ajax({
                url: url,
                type: 'POST',
                returnType: 'html',
                data: JSON.stringify(data),
                contentType:'application/json',
                success: successFunc
            });

Any ideas why this is happening and what to do about it?

Thanks for any help.

  • 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-05-24T06:08:13+00:00Added an answer on May 24, 2026 at 6:08 am

    Your problem is the semi-colon after:

    @Html.WritePagerRow(Model);
    

    If you look closely in Visual Studio, you’ll see that the semi-colon doesn’t have a light gray background but a white one. That means it is regarded as HTML code, not as C# code.

    Remove the semi-colon and your problem will be gone.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two simple tables in my database. A card table that contains Id,
I have a submission table that is very simple: userId, submissionGuid I want to
I have a very simple table that contains a list of 'victims' and the
I have a very simple SQL table that I want to import into Solr
In my database I have a simple table that contains values showing the basic
Suppose I have a simple MySQL table that looks like this: CREATE TABLE `my_table`
I have an Excel spreadsheet of some product data, (just a simple table) that
I have a simple employee table that I want to display in a particular
I have a simple table in MySql whose raison-d'être is to store logs. The
I have a simple database table called Entries: class CreateEntries < ActiveRecord::Migration def self.up

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.