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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:52:42+00:00 2026-06-17T23:52:42+00:00

I use knockoutJS and i had the following error when i use fromJS TypeError:

  • 0

I use knockoutJS and i had the following error when i use “fromJS”

TypeError: Cannot call method ‘fromJS’ of undefined

My JavaScript Code

 <script src="../../Scripts/jquery-1.8.3.js" type="text/javascript"></script>
 <script src="../../Scripts/knockout-2.1.0.js" type="text/javascript"></script>


 <script type="text/javascript">
     $(document).ready(function () {
         var PersonModel = function (data) {
             ko.mapping.fromJS(data, {}, this);
         };

         var data = $.getJSON("http://localhost:40913/candidate/index/1", function (data)
         {
             viewModel = new PersonModel(data);
             ko.applyBindings(viewModel);
         }
         );
     });
 </script>

JSON Output

{
PersonalInfo: {
PTitle: null,
PGender: {
Id: 1,
Name: "Male",
IsDeleted: false,
LastModified: "2013-01-21T00:00:00",
ModifiedBy: "System Auto Generated"
},
PMilitaryService: {
Id: 2,
Status: "Exempted",
IsDeleted: false,
LastModified: "2013-01-21T00:00:00",
ModifiedBy: "System Auto Generated"
},
PMarital: {
Id: 2,
Status: "Engaged",
IsDeleted: false,
LastModified: "2013-01-21T00:00:00",
ModifiedBy: "System Auto Generated"
},
PNationality: {
Id: 1,
NationalityName: "Egyptian",
IsDeleted: false,
LastModified: "2013-01-21T00:00:00",
ModifiedBy: "System Auto Generated"
},
Id: 1,
FirstName: "Jason",
SecondName: "J",
ThirdName: "Patrick",
FourthName: "Jules",
BirthDate: "2013-01-01T00:00:00",
GenderId: 1,
MilitaryServiceId: 2,
MaritalId: 2,
NationalityId: 1,
IsDeleted: null,
LastModified: "2013-01-21T13:32:20.437",
ModifiedBy: null,
FullName: "fhfghfghfghgfhg"
},
TraineeInfo: null,
AdressInfo: {
PCity: {
Id: 6,
Name: "Cairo",
IsDeleted: false,
LastModified: "2013-01-21T00:00:00",
ModifiedBy: "System Auto Generated"
},
PCountry: {
Id: 1,
Name: "France",
IsDeleted: false,
LastModified: "2013-01-21T00:00:00",
ModifiedBy: "System Auto Generated"
},
Id: 1,
Street: "5th Ave",
District: "6th Area",
CityId: 6,
CountryId: 1,
IsDeleted: null,
LastModified: "2013-01-21T13:32:20.437",
ModifiedBy: null
},
ContactInfo: {
Id: 1,
PhoneNumber: "12345678",
MobileNumber: "2012415413",
Email: "a@b.com",
EmailConfirm: null,
IsDeleted: null,
LastModified: "2013-01-21T13:32:20.437",
ModifiedBy: null
},
HighSchool: {
PSchoolCertificate: {
Id: 1,
Name: "Thanwya Amma",
IsDeleted: false,
LastModified: "2013-01-21T00:00:00",
ModifiedBy: "System Auto Generated"
},
Id: 1,
Name: "El Nasr School",
SchoolCertificateId: 1,
GraduationYear: "2013-01-10T00:00:00",
OverallGrade: 90,
OtherSchoolCertificate: null,
IsDeleted: null,
LastModified: "2013-01-21T13:32:20.437",
ModifiedBy: null
},
Type: {
Id: 1,
Type: "Fresh Graduate",
IsDeleted: false,
LastModified: "2013-01-21T00:00:00",
ModifiedBy: "System Auto Generated"
},
Certifications: [ ],
TrainingCourses: [ ],
CareerHistories: [ ],
Universities: [
{
PCertificate: {
Id: 1,
CertificateType: "BACHELOR",
IsDeleted: false,
LastModified: "2013-01-21T00:00:00",
ModifiedBy: "System Auto Generated"
},
PUniversityName: {
Id: 2,
Name: "ABBASSIA",
IsDeleted: false,
LastModified: "2013-01-21T00:00:00",
ModifiedBy: "System Auto Generated"
},
PFaculty: {
Id: 1,
Name: "ACCOUNTING",
IsDeleted: false,
LastModified: "2013-01-21T00:00:00",
ModifiedBy: "System Auto Generated"
},
PSpecialization: {
Id: 2,
Name: "ACCOUNTING ENGLISH",
IsDeleted: false,
LastModified: "2013-01-21T00:00:00",
ModifiedBy: "System Auto Generated"
},
PGrade: {
Id: 3,
OverallGrade: "Very Good",
IsDeleted: false,
LastModified: "2013-01-21T00:00:00",
ModifiedBy: "System Auto Generated"
},
Id: 1,
CertificateId: 1,
OtherCertificate: null,
UniversityNameId: 2,
OtherUniversity: null,
FacultyId: 1,
OtherFaculty: null,
SpecializationId: 2,
OtherSpecialization: null,
GraduationYear: "2013-01-04T00:00:00",
GradeId: 3,
IsDeleted: null,
LastModified: "2013-01-21T13:32:20.437",
ModifiedBy: null
}
],
Languages: [
{
PLangName: {
Id: 1,
Name: "English",
IsDeleted: false,
LastModified: "2013-01-21T00:00:00",
ModifiedBy: "System Auto Generated"
},
PLangProf: {
Id: 4,
LanguageProf: "Native",
IsDeleted: false,
LastModified: "2013-01-21T00:00:00",
ModifiedBy: "System Auto Generated"
},
Id: 1,
LangNameId: 1,
LangProfId: 4,
IsDeleted: null,
LastModified: null,
ModifiedBy: null
}
],
TestInfo: null,
InterviewInfo: null,
TechnicalInterview: null,
MedicalTest: null,
SecuirtyTest: null,
HREmployee: null,
Id: 1,
Ssid: "28454654654545",
SsidConfirm: null,
Status: null,
StatusId: 1,
RefCode: "8951000000",
ApplicationTypeId: 1,
EntryDate: "2013-01-21T13:32:20.437",
Skills: "aaksdklasdjkl asd asd d d d g ghs fgdsfgd",
Photo: null,
IsDeleted: null,
LastModified: "2013-01-21T13:32:20.437",
ModifiedBy: null
}
  • 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-17T23:52:44+00:00Added an answer on June 17, 2026 at 11:52 pm

    Get the plugin from

    https://raw.github.com/SteveSanderson/knockout.mapping/master/build/output/knockout.mapping-latest.js
    

    and add it via:

    <script src="../../Scripts/knockout.mapping-latest.js" type="text/javascript"></script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am fairly new to knockoutJS and cannot figure out how to use the
is it possible to use an external Template in KnockoutJS like this? <script type=text/html
I am writing a custom binding to use $.expandingTextarea with Knockout.js . Following the
I am trying to use KnockoutJS on Node.js. Found one implementation of the same
I'm trying to use KnockoutJS to build an interactive dashboard with data bindings on
I want to use $index in KnockoutJS to show alphabets instead of numbers.e.g, A.
I am having a problem with the new anonymous template engine. It cannot use
I'm trying to use KnockoutJS with jQuery mobile and I've run into a problem
I have a jQuery template, and I would like to use a KnockOutJS template
I'm new to KnockoutJs and I'm trying to use it with ASP.net webforms in

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.