---
title: "jQuery options for method stop working"  
description: "jQuery options for method stop working"  
author: "E E Cummings"  
published: 2013-07-20  
updated: 2013-07-20  
canonical: https://www.mindstick.com/forum/1343/jquery-options-for-method-stop-working  
category: "jquery"  
tags: ["jquery"]  
reading_time: 2 minutes  

---

# jQuery options for method stop working

Hell [developers](https://www.mindstick.com/articles/12875/blunders-you-must-avoid-while-hiring-java-developers-to-get-the-best-fulfilling-your-needs)!

I'm not sure if the [question](https://www.mindstick.com/blog/23175/how-to-solve-neet-question-paper-in-less-time) were asked already but I've live example so I hope my question may be useful. Here I've custom plugin for jQuery:

([function](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server)($){

jQuery.alertSay = function(options){

var options = $.extend({say:'open'}, options};

alert('We are currently ' + say + '!');

};

})(jQuery);

[connected](https://www.mindstick.com/articles/12941/link-building-and-search-engine-rankings-how-are-they-connected) to the main index.html:

$([document](https://www.mindstick.com/articles/328642/what-to-consider-while-choosing-a-software-documentation-tool)).ready(function() {

$.alertSay({

say: 'on vacations'

});

});

And it doesn't work because of options, cause if I use simple method without any options, like this:

(function($){

jQuery.alertSay = function(){

alert('We are currently on vacations!');

};

})(jQuery);

It works just fine with the link like:

$(document).ready(function() {

$.alertSay();

});

Due to my poor [knowledge](https://www.mindstick.com/forum/156160/what-is-google-knowledge-graph) in jQuery I'm unable to detect where my mistake is and it would be so nice from you to help [me if](https://answers.mindstick.com/qa/50259/tell-me-if-your-system-is-infected-by-a-virus-how-you-will-recover-the-data) possible. Thank you!

UPD: Thank you for your replies but unfortunately replacing

alert('We are currently ' + say + '!');

with

alert('We are currently ' + options.say + '!');

change nothing, no alert at all. But I've some errors:

Uncaught [SyntaxError](https://www.mindstick.com/forum/159404/a-database-query-returns-a-syntaxerror): [Unexpected token](https://www.mindstick.com/forum/34353/error-messagesystem-queryexception-unexpected-token) } hallo.js:3

Uncaught [TypeError](https://www.mindstick.com/forum/157755/calling-a-class-member-function-gives-typeerror-in-python-why): Object function (a,b){return new p.fn.init(a,b,c)} has no method 'alertSay' (in the html on string $.alertSay({)

thanks in advance

## Replies

### Reply by shreesh chandra shukla

Hello!

In your 1st snippet code replace say with options.say

```
(function($){    jQuery.alertSay =
function(options){        var options =
$.extend( options , {say:'open'}); // some error here        alert('We are
currently ' + options.say + '!');    };})(jQuery);
```


---

Original Source: https://www.mindstick.com/forum/1343/jquery-options-for-method-stop-working

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
