---
title: "Call function in custom function"  
description: "Call function in custom function"  
author: "Anonymous User"  
published: 2013-05-03  
updated: 2013-05-03  
canonical: https://www.mindstick.com/forum/803/call-function-in-custom-function  
category: "mssql server"  
tags: ["mssql server"]  
reading_time: 1 minute  

---

# Call function in custom function

Hi Everyone!\
I'm [trying](https://answers.mindstick.com/qa/93698/6-mistakes-couples-are-trying-to-save-money) to [figure](https://yourviews.mindstick.com/view/87536/what-are-ghosts-jobs-and-how-to-figure-out-them) out how this [custom](https://www.mindstick.com/blog/12298/use-custom-writing-services-to-get-through-the-finals) jQuery [functions](https://www.mindstick.com/forum/160140/explain-the-role-of-functions-as-a-service-faas-in-serverless-computing) work by experimenting a bit. I can't however get it to work properly. I'm trying to call the prepareSlide \
[function](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) in my setInterval but it says prepareSlide is not defined\
$('[document](https://www.mindstick.com/articles/328642/what-to-consider-while-choosing-a-software-documentation-tool)').ready(function(){ jQuery('.item_holder').itemSlider({ start: 1, [carousel](https://www.mindstick.com/forum/1014/how-to-create-carousel-in-sencha-touch): [true](https://yourviews.mindstick.com/view/81326/boycott-chinese-products-dream-will-come-true) });});$.fn.itemSlider = function (details) { var currentSlideNumber = (details && details.start > 0) ? details.start : 1; this.prepareSlide = function(slideNumber) { [alert](https://answers.mindstick.com/qa/30927/what-is-an-alert)(1) } //Set an interval var itemToSlide = currentSlideNumber + 1; slideTimer = setInterval("prepareSlide(" + itemToSlide + ")", 5000);}\
Please help me!Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)!\

## Replies

### Reply by AVADHESH PATEL

Hi Samuel!\
Also, to provide the context properly to the function invocation, a quick method is to preserve this by having another variable reference it, which in this case, we call self\
var self = this;\
slideTimer = setInterval(function(){ self.prepareSlide(itemToSlide)}, 5000);


---

Original Source: https://www.mindstick.com/forum/803/call-function-in-custom-function

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
