Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/399.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在object.prototype.render期间但在另一个.js文件中添加方法_Javascript_Jquery_Wordpress - Fatal编程技术网

Javascript 在object.prototype.render期间但在另一个.js文件中添加方法

Javascript 在object.prototype.render期间但在另一个.js文件中添加方法,javascript,jquery,wordpress,Javascript,Jquery,Wordpress,网站-Wordpress 使用的插件- 插件Js文件- JS文件的第121行 /** * Renders the results from a successful response. */ Scroller.prototype.render = function( response ) { this.body.addClass( 'infinity-success' ); // Check if we can wrap the html this.element.

网站-Wordpress

使用的插件-

插件Js文件-

JS
文件的第121行

/**
 * Renders the results from a successful response.
 */
Scroller.prototype.render = function( response ) {
    this.body.addClass( 'infinity-success' );

    // Check if we can wrap the html
    this.element.append( response.html );

    this.body.trigger( 'post-load', response );
    this.ready = true;
}
基本上,我想在附加数据之前修改一些html

唯一的问题是我无法修改插件
Js
文件,因为它可能会得到更新,所有的更改都会丢失

是否可以在另一个
JS
文件中扩展插件

/**
 * Renders the results from a successful response.
 */
Scroller.prototype.render = function( response ) {
    this.body.addClass( 'infinity-success' );

    // changed html
    this.element.find('.infinite-wrap .loading-message').html('Next post is loaded');

    // Check if we can wrap the html
    this.element.append( response.html );

    this.body.trigger( 'post-load', response );
    this.ready = true;
}

我不太精通面向对象的javascript(现在是:D),但这能帮上忙吗:你说“不能修改js是什么意思,因为它可能会得到更新,所有的更改都会丢失?”你不能下载该文件并对该文件进行更改吗?在wordpress中,有一个检查上次更新的示例:每个插件在xx天前更新,并且在每次更新中,插件开发人员在该插件中实现了新的内容。检查,在更新过程中,所有文件都更新@mrapsogos是的,但你可以下载特定的文件版本,并根据该版本进行所需的更改。这有什么问题?不应该是这样@mrapsogos