Skip to content
This repository was archived by the owner on Sep 10, 2020. It is now read-only.

Commit 07995bc

Browse files
committed
修正:修正事件与标签对应关系
1 parent 746f523 commit 07995bc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/jquery.ajaxloadpage.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
//默认赋值
99
_this.options = $.extend({}, AjaxLoadPage.DEFAULTS, options);
1010
//处理打开事件
11-
$(element).on(_this.options.trigger, _this.options.bindNodes, function () {
12-
//根据节点数据
13-
if (this.tagName === "A") {
11+
$(element).on(_this.options.trigger, _this.options.bindNodes, function (event) {
12+
//根据事件类型与节点名称,设置数据
13+
if (event.type === 'click' && this.tagName === "A") {
1414
newUrl = $(this).attr("href");
1515
urlData = null;
16-
} else if (this.tagName === "FORM") {
16+
} else if (event.type === 'submit' && this.tagName === "FORM") {
1717
newUrl = $(this).attr("action");
1818
urlData = $(this).serialize();
1919
} else {

0 commit comments

Comments
 (0)