javascript - Send a variable to jquery function -
i have been trying pass variable _f.search in no luck, can please help?
(function(window, $) { // 'use strict'; //setinterval(function () {alert("hello")}, 3000); var streamtable = function(container, opts, data) { return new _streamtable(container, opts, data); }; _f.search = function(text){ alert("search " + text); var q = $.trim(text), count = 0; // alert(this.last_search_text); if (q == this.last_search_text) return; this.last_search_text = q; if(q.length == 0 ){ this.render(0); }else{ this.searchindata(q); this.render(0); } this.current_page = 0; this.renderpagination(this.pagecount(), this.current_page); this.execcallbacks('pagination'); }; } i tried
onclick ="window.search(5)" from click button still did not work.
the search function should declared this:
window.search = function(text){ this attach search function window object. allow attach onclick event, have in example:
onclick="window.search(5)"
Comments
Post a Comment