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

The Archive Base Latest Questions

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

Still working through JQuery to get data and repopulate portions of a page. Right

  • 0

Still working through JQuery to get data and repopulate portions of a page. Right now I cannot get it to return data but it does pop an error saying “data is undefined”.

Code:

var retrieveData2 = function(path, productGroup, productType, itemsPerPage, pageIndex, filters, fnHandleCallback) {
    $.getJSON(path
             , { productGroup: productGroup, productType: productType, itemsPerPage: itemsPerPage, pageIndex: pageIndex, filter: filter }
             , function(data) { fnHandleCallback(data); });
};

function updateNavIndex(pageIndex) {
    var filters = $("form").serialize();
    var productGroup = $("#valProductGroup").attr('title');
    var productType = $("#valProductType").attr('title');
    var itemsPerPage = $("#ItemsPerPage").val();

    retrieveData2("/CatalogAjaxController/UpdateNavigation", productGroup, productType, itemsPerPage, pageIndex, filters, handleMenuData(data));
}

function handleMenuData(data) {
    $("#CatalogPagingMenu").remove();

    // [http://ejohn.org/blog/javascript-micro-templating/][apply data to template]
    }

when the updateNavIndex function is called I get an error of “Microsoft JScript runtime error: ‘data’ is undefined”.

What am I missing?


ah! closer (the answer with 1 vote right now) – yet no server call is being made. It goes directly to the callback handler. 🙁


Got it working for the most part. My URL was pointing at CatalogAjaxController. It should point to CatalogAjax as MVC knows it is a controller.

  • 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-11T18:17:08+00:00Added an answer on May 11, 2026 at 6:17 pm

    Instead of:

    retrieveData2("/CatalogAjaxController/UpdateNavigation", productGroup, productType, itemsPerPage, pageIndex, filters, handleMenuData);
    

    I needed to do:

    retrieveData2("/CatalogAjax/UpdateNavigation", productGroup, productType, itemsPerPage, pageIndex, filters, handleMenuData);
    

    Because of my routes I ended up changing it to:

    retrieveData2("/Catalog/Ajax/Update/Navigation", productGroup, productType, itemsPerPage, pageIndex, filters, handleMenuData);
    

    Notice the word “Controller” is not part of the path now. Kudos to the help on this. No exactly right answer but all answers gave me the meat to get through this. Special kudos to Ben Scheirman for some of his time today to show me around FireBug and using $.ajax with Partial Views!

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

Sidebar

Related Questions

I made a small example HTML page to get JQuery's getJSON method working. It
Through jQuery and the use of an ajax get I have a working model
I'm still working my way through some pretty basic Actionscript programming (in Flex), and
So, I'm quite new to Rails and still working my way through the principles.
Just trying to get the nivo slider plugin for jquery working on a basic
I'm attempting to send a piece of data through jQuery .ajax() to a PHP
I'm making a standard JQuery .ajax call, already jumped through hoops to get it
I am quite new to jquery and am gradually working through my book! I
Having trouble trying to get this simplified. Still somewhat new to jQuery so please
Still working on lisp recipes and idioms. I have a list like this: ((a

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.