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

  • SEARCH
  • Home
  • 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 8441835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:40:32+00:00 2026-06-10T08:40:32+00:00

When using JQuery .ajax my content is put into a new page instead of

  • 0

When using JQuery .ajax my content is put into a new page instead of replacing the specified element. I use something very similar in the same site with no problems, but this one section does not like something and throws this error:

Microsoft JScript runtime error: Object expected

After selecting Continue it loads the data into a new page instead of the specified selector.

I have the following included in the _Layout page:

  • < script src=”@Url.Content(“~/Scripts/jquery-1.7.2.min.js”)” type=”text/javascript”/>
  • < script src=”@Url.Content(“~/Scripts/jquery-ui-1.8.11.min.js”)” type=”text/javascript”/>
  • < script src=”@Url.Content(“~/Scripts/jquery.unobtrusive-ajax.js”)” type=”text/javascript”/>

The page code is as follows:

<link href="../../Content/themes/base/jquery.ui.autocomplete.css" rel="stylesheet" type="text/css" />
<link href="../../Content/Tasks.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">
$(document).ready(function () {
    $('#btnSaveNewTicket').hide();
    $('#frmTaskDetail').one('submit', function (e) {
        e.preventDefault();
        alert('tru dat');
        $.ajax(
        {
            cache: false,
            async: true,
            type: "POST",
            url: $(this).attr('action'),
            data: $(this).serialize(),
            success: function (data) {
                $('#divTaskDetail').empty();                
                $('#divTaskDetail').html(data);
            },
            complete: function () {
                $('#hidTdAccId').val('');
                $('#hidTdUserId').val('');
                $('#hidTdTicketId').val('');
            }
        });
        return false;
    });

});
</script>

<div id="divTaskDetail">
@using (Html.BeginForm("DetermineTicketAction", "Dispatch", FormMethod.Post, new { id = "frmTaskDetail" }))
{
<div style="background-color: #2C6B87; width: 99%; border: 1px black solid; text-align: left; text-indent: 5px; margin: 1% 0 0 0; padding: 5px 0 5px 0; font-size: 12px; color: white; font-weight: bold">
    Task Details
</div>
<div style="width: 99%; border: 1px black solid;">

    @Html.Hidden("AccountId")       
    @Html.Hidden("ContactId")
    @Html.Hidden("CompanyId")
    @Html.Hidden("TicketId")
    @Html.Hidden("TicketCreated")
    @Html.Hidden("Created")
    @Html.Hidden("TicketClosed")
    @Html.Hidden("isActive")

    <table id="tblTaskDetail" style="width: 100%; text-indent: 5px; color: White; margin: 0 auto; font-size: 12px; top: 0; left: 0;">                    
                <tr>
                    <td>Ticket ID</td>
                    <td>@Html.TextBox("TicketId" ,null, new { @disabled = true })</td>
                    <td>Address</td>
                    <td>@Html.TextBox("Address", null, new {@disabled = true })</td>

                </tr>
                <tr>
                    <td>Date Created</td>
                    <td>@Html.TextBox("Created",null, new { disabled = true })</td>
                    <td>City</td>
                    <td>@Html.TextBox("City",null, new { disabled = true })</td>
                </tr>
                <tr>
                    <td>Company Name</td>
                     <td>@Html.TextBox("CompanyName")<input type="button" id="addCompany" value="+" /></td>
                    <td>State</td>
                    <td>@Html.TextBox("State",null, new { disabled = true })</td>
                </tr>
                <tr>
                    <td>Customer Name</td>                    
                    <td>@Html.TextBox("ContactName")<input type="button" id="addContact" value="+" /></td>
                    <td>Zip Code</td>
                    <td>@Html.TextBox("ZipCode", null, new { disabled = true })</td>
                </tr>
                <tr>
                    <td>Category</td>
                    <td>@Html.DropDownList("CategoryId")</td>
                    <td>Phone Number</td>
                    <td>@Html.TextBox("Phone", null, new { disabled = true })</td>
                </tr>
                <tr>
                    <td>Status</td>
                    <td>@Html.DropDownList("StatusId")</td>
                    <td>E-mail</td>
                    <td>@Html.TextBox("Email", null, new { disabled = true })</td>
                </tr>
                <tr>
                    <td>Priority</td>
                    <td>@Html.DropDownList("PriorityId")</td>
                    <td>Paid</td>
                    <td>@Html.DropDownList("Paid")</td>
                </tr>
                <tr>
                    <td>Task Description</td>
                    <td>@Html.Editor("Description")</td>
                    <td>Assign To</td>
                    <td>@Html.DropDownList("UserId")</td>
                </tr>       
    </table>
    <table style="width: 100%; text-indent: 5px; color: White; margin: 0 auto; font-size: 12px; top: 0; left: 0;">
        <tr>
            <td>Comments @Html.TextBox("Comments", "", new { style = "width: 15%" })</td>
         </tr>
        <tr>
            <td> 
                @Html.ListBox("CommentList", @ViewBag.CommentList as IEnumerable<SelectListItem>, new { id="CommentList", style = "font-size: 10px" })
            </td>
        </tr>
    </table>

    <input type="hidden" id="hidTdAccId" name="hidTdAccId" value="" />
    <input type="hidden" id="hidTdUserId" name="hidTdUserId" value="" />
    <input type="hidden" id="hidTdTicketId" name="hidTdTicketId" value="" />
    <input type="hidden" id="hidSubType" name="hidSubType" value="" />
</div>

<input type="submit" id="btnSave" name="btnSave" value="Save" />
<input type="button" id="btnClearTicket" name="btnClearTicket" value="New Ticket"/>
<input type="submit" id="btnSaveNewTicket" name="btnNewTicket" value="Save New Ticket" />
<input type="submit" id="btnGetDetail" name="btnGetDetail"  style="visibility: hidden"  />
}
</div>

Any help/thoughts are appreciated. Thanks!

  • 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-10T08:40:34+00:00Added an answer on June 10, 2026 at 8:40 am

    For some reason, the Jquery ajax works fine in chrome/safari, but it would not work for IE. Replacing JQuery Ajax with the Ajax helper did the trick for me.

    Thanks for the help and suggestions. +1 for your time and intelligent approach.

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

Sidebar

Related Questions

I have some content that I am loading using jquery ajax. The content has
So I have a system using jQuery AJAX to load the content dynamically. I
I am using the jquery ajax api so load in some content, the code
I'm using jQuery UI Tabs to load some content via Ajax when the user
How do I bind / initialize Shadowbox to content loaded by jQuery using AJAX?
I am using jquery-ui tabs and ajax to load the content of the tabs.
I have a jQuery ajax function that loads some content into a div, some
I have an Ajax control that is loaded into a Yahoo popup using jQuery.
Sup guys. I'm loading data into a table using ajax and jquery. This can
I have a page where I am using jquery/ajax to pull down a chunk

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.