ajax - Call a javascript function from outside its object -


I can do some simple JavaScript that far I have not but tell should work.

The code is below

var presenter = new practice. Web. // This Ajax.Net function is a class generated by GetLetters () {var GetLettersParams = new object (); GetLettersParams.TemplateType = $ ('# LetterTypes'). Val (); Var letter = ajaxCall (presenter, Gatoreller, Gail Letterpers); CreateOptions ('template', letter, 'id', 'name', true); } Function Ajaxcol (Ajax method, parameters) {var response = AJAX symbol (parameter); // If the message fails here (response.error! = Null) {Warning ('An error has occurred; r \ n' + response.error.Message); Return; } Return response value; }

this creates part of the class Ajax.Net

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

Any ;: getLettersParams) {(this.GetLetters.getArguments getLettersParams} ( "GetLetters", { "getLettersParams") this.invoke return piece (1)).} Colin G

The first parameter is Should have, that is the object. If the function is called again to follow function parameters as different values:

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

You must use a function to call it with an array. apply () should be a method which takes the object is called as the first parameter:

  func.apply (someobj, parameter);  

Then something like this will appear in your case:

  function ajax call (Ajax method, obje, parameter) {var response = ajax methol, parameter} ; // ...} var characters = ajaxCall (presenter, gatelater, presenter, gate letters parameters);  

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -