Adding additional parameter to function
I did not write the code below so I don't completely understand it but I want to pass an additional parameter from MyWebPage.aspx to the checkAvailability function. I'm calling the same function from different pages and I want to be to determine which page it came from
- checkAvailability.js
-
-
- (function($){
- $.fn.checkAvailability = function(opts) {
- opts = $.extend({
- target: '#response',
- trigger: '#btnCheck',
- ajaxSource: 'checkBorrowerNumber.aspx',
- fireOnKeypress: true
- }, opts || {});
- };
-
- MyWebPage.aspx
-
- <script type="text/javascript">
- $(document).ready(function () {
-
- $("#MainContent_txtBorrowerNumber").checkAvailability();
- });
- </script>
-
- <asp:TextBox ID="txtBorrowerNumber" runat="server" CssClass="inputBox" TabIndex="4" /> <input id="btnCheck" type="button" value="Check Borrower ID" class="btn btn-sm btn-primary" /><span id="response" class="alert-danger"><!-- Our message will be echoed out here --></span>