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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:04:19+00:00 2026-05-12T06:04:19+00:00

I have some simple javascript that as far as i can tell should work

  • 0

I have some simple javascript that as far as i can tell should work but doesn’t.

The code is below

var presenter = new Practicum.Web.TEI.StudentPlacement2009.CreateLetter_class(); //this is a class generated by Ajax.Net

function GetLetters() {
    var GetLettersParams = new Object();
    GetLettersParams.TemplateType = $('#LetterTypes').val();
    var letters = ajaxCall(presenter.GetLetters, GetLettersParams);
    createOptions('Templates', letters, 'Id', 'Name', true);
}

function ajaxCall(ajaxMethod, parameters) {
    var response = ajaxMethod.call(parameters); //fails here with the message in
    if (response.error != null) {
        alert('An error has occured\r\n' + response.error.Message);
        return;
    }
    return response.value;
}

this is part of the class Ajax.Net produces.

Practicum.Web.TEI.StudentPlacement2009.CreateLetter_class = function() {};
Object.extend(Practicum.Web.TEI.StudentPlacement2009.CreateLetter_class.prototype, Object.extend(new AjaxPro.AjaxClass(), {
GetLetterTypes: function() {
return this.invoke("GetLetterTypes", {}, this.GetLetterTypes.getArguments().slice(0));
},
GetDegrees: function() {
return this.invoke("GetDegrees", {}, this.GetDegrees.getArguments().slice(0));
},
GetLetters: function(getLettersParams) {
return this.invoke("GetLetters", {"getLettersParams":getLettersParams}, this.GetLetters.getArguments().slice(1));
} ...

Any help would be much appriciated;
Colin G

  • 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-12T06:04:20+00:00Added an answer on May 12, 2026 at 6:04 am

    The first parameter that needs to be passed to Function.call() is the object on which the function is called. Then follow the function parameters as separate values:

    func.call(someobj, param1, param2, ...);
    

    To call a function with an array of arguments you should use apply(). apply() also takes the object for which the method should be called as first parameter:

    func.apply(someobj, params);
    

    So in your case it would look something like this:

    function ajaxCall(ajaxMethod, obj, parameters) {
      var response = ajaxMethod.call(obj, parameters);
      // ...
    }
    
    var letters = ajaxCall(presenter.GetLetters, presenter, GetLettersParams);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a fairly simple const struct in some C code that simply holds
I have some JavaScript that can appear on many different pages. Sometimes those pages
I have some simple shell scripting tasks that I want to do For example:
I have some very simple code to generate an assembly and invoke a method
I have some code I've written in PHP for consuming our simple webservice, which
Currently, I have some basic code to play a simple tone whenever a button
How to build a simple recommendation system? I have seen some algorithms but it
I have a simple WPF (XAML) file that has some animated shapes and text.
I have a simple class that essentially just holds some values. I have overridden
I'm trying to write some simple chat client in javascript, but I need 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.