How to overwrite JQuery plugin function?
How to overwrite a function which is from a JQuery plugin? I am trying to overwrite a function in csv2table plugin called mkTable() in my o开发者_高级运维wn javascript file. Is it possible? Here is the original definition:
$.fn.csv2table= function(url,setting) {
function mkTable(id,rowsAry){
...
}
}
You can't do it from outside the csv2table
function scope since it is private to that scope.
Looked at the source. There's nothing you can do.
The function is declared inside a closure and you don't have any access to it.
The real question is why are you parsing csv using a jQuery plugin?
It would be better to have the server handle the csv files and give the client JSON.
精彩评论