Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIDefinining a callback functionDefinining a callback function
Previous
 
Next
New Post
12/16/2005 1:18 PM
 


Hello,

Just a simple question, i think.

how can i define a function in the ClientAPI, that i can call in java script.

I want to define a function that uses the _timer in javascript to periodacally call the server.

I know the javascript timer side of the code, but as far as the client api i only know the add.attributte method to attach a function to a on click event.

I don't want this function to be attached to no event, just to be able to use anywhere inside my javascript functions.

regards,

jamador 

 
New Post
1/9/2006 6:20 PM
 

Not sure I understand the question...  if you simply want to define a function that can be called from anywhere in your code, then define the function somewhere on the page or in a referenced js file... 

The confusing statement is "I don't want this function to be attached to no event"... double negative???


 
New Post
1/10/2006 8:09 AM
 

Ok, sorry about my bollean english confusion, let me reformulate the question.

To call the server side code we add an attribute to the "onclick" event of a button or control, this is all working, but what i was looking for was just a way to call the server side code inside my javascript function, something like :

function Some_JavaScript_Function() {

var GetValue = Server_Side_Code(); 

} 

Regards,

João Amador

 
New Post
1/10/2006 4:15 PM
 
Any luck with this? I'm trying to do the same thing. I've done it using Ajax.Net Professional but I'd like to do it within the scope of the native abilities of DNN. I'm doing some client side click logging so I just want to run a javascript function which will call a server side function as you've mentioned.

Richard
 
New Post
1/10/2006 4:49 PM
 

The code that represents the client callback is returned from the ClientAPI.GetCallbackEventReference.  This is commonly associated to a control's event (i.e. onclick), but could just as easily be assigned to a client side variable as a string.  You could then invoke it through the eval function.  Probably a better solution would be to enclose it within a function instead of assigning it to a variable.

s = "function myfunc() { " & ClientAPI.GetCallbackEventReference(...) & "}"

Obviously I left the details of this out.


 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIDefinining a callback functionDefinining a callback function


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out