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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:21:14+00:00 2026-05-31T09:21:14+00:00

I am using a dropdown for marking messages are read, I have implemented it

  • 0

I am using a dropdown for marking messages are read, I have implemented it with ajax call, it is working fine on IE and Chrome but i am having issue in firefox, after reutrning data from my Controller, success function of below code has an argument name result, in IE and
Chrome it is working fine( i am sending its value true) but in case of firefox it is showing error msg(ReferenceError: result is not defined) i have checked this error on console. I am using Jquery’s version 1.6

 $("#mark").change(function () {
            var message = $('#move_folder').val();
            $.ajax({
                type: 'POST',
                contentType: 'application/json; charset=utf-8',
                url: '/Message/TakeActions'
                            + '?message=' + message,
                dataType: 'json',
                data: $.toJSON(msgsData),
                success: function (result) {
                    if (result == true) {
                        // window.location.href = "/inviteFriends/Index";
                        window.location.reload();
                        DivMsgText("Message moved successfully to" + message);                            
                        $("#selectall").removeAttr("checked");
                        for (var i = 0; i < $('.case').length; i++) {
                            if ($('.case')[i].checked)
                                $('.case')[i].checked = false;
                        }
                    }
                    else {
                        if (message == "mark_read") {
                            alert("Select a message to mark as read");
                        }
                        else {
                            // DivMsgText("Select a message to move");
                            alert("Select a message to move");
                        }
                        $("#divmsg").empty();
                        $("#divmsg").removeClass("success grid_9");
                        $("#divmsg").html().remove();
                    }
                },               
                async: false,
                cache: false
            });
        });
  • 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-31T09:21:15+00:00Added an answer on May 31, 2026 at 9:21 am

    Try replacing the following loop:

    for (var i = 0; i < $('.case').length; i++) {
        if ($('.case')[i].checked)
            $('.case')[i].checked = false;
    }
    

    with this:

    $('.case').removeAttr('checked');
    

    Also make sure you properly URL encode your query string parameters:

    '?message=' + encodeURIComponent(message)
    

    Also you shouldn’t be using any javascript after window.location.reload();. This function does what it name suggests: it reloads the page by navigating away from it which as a consequence might stop the execution of any subsequent js.

    Also try to return a valid JSON object from your TakeActions controller action:

    public ActionResult TakeActions()
    {
        ...
        return Json(new { status = true });
    }
    

    and then on the client side use the following test:

    success: function(result) {
        if (result.status) {
            ...
        } else {
            ...
        }
    }
    

    The problem with your code is that I suspect you only returned true:

    public ActionResult TakeActions()
    {
        ...
        return Json(true);
    }
    

    which sends the string true into the response which is an invalid JSON string and yet you are telling jQuery that your server returns JSON by setting dataType: 'json'.

    And yet another remark: you seem to be using some message variable which is not declared anywhere in the scope you have shown in your question. Is this variable actually declarzed somewhere? Is it declared in a scope which is accessible within your function?

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

Sidebar

Related Questions

Having created dropdown lists using ViewBag which is working in an edit form. How
I am making ajax call using ASP.NET 3.5 to populate dropdown list as a
I'm running into a character encoding issue when I load a dropdown using jQuery
I have a templated column. I am using a Dropdown as header template and
I have a question with Twitter Bootstrap, I'm using the Dropdown plugin and I'm
I am just trying to populate a html.dropdown list using mvc2 in VS2008. But
I have a slight problem, I'm making a dropdown using the help from someone
So I'm making an auto-complete dropdown list, using javascript. It works fine in IE8+,
I am making ajax call(ASP.NET 3.5) from dropdown change handler and trying to pass
I am using a dropdown to allow the user to sort search results. These

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.