Skip to content

Commit ca878de

Browse files
committed
Merge pull request #65 from zhangxinxu/develop
Develop
2 parents 441c563 + e8d9b5c commit ca878de

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mobilebone",
3-
"version": "2.3.0",
3+
"version": "2.3.1",
44
"description": "Bone main for mobile web APP with a sigle page mode.",
55
"main": "src/mobilebone.js",
66
"directories": {

src/mobilebone.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
*
3939
* @type string
4040
**/
41-
Mobilebone.VERSION = '2.3.0';
41+
Mobilebone.VERSION = '2.3.1';
4242

4343
/**
4444
* Whether catch attribute of href from element with tag 'a'
@@ -828,7 +828,7 @@
828828
// if not ajax request
829829
if (target.getAttribute("data-rel") == "external"
830830
|| ajax == "false"
831-
|| (href.split("/")[0] !== location.href.split("/")[0] && ajax != "true")
831+
|| (href.replace("://", "").split("/")[0] !== location.href.replace("://", "").split("/")[0] && ajax != "true")
832832
|| (Mobilebone.captureLink == false && ajax != "true")
833833
) return;
834834

@@ -917,7 +917,7 @@
917917
if (/^javascript/.test(href)) {
918918
if (back == false) return;
919919
} else {
920-
external = external || (href.split("/")[0] !== location.href.split("/")[0]);
920+
external = external || (href.replace("://", "").split("/")[0] !== location.href.replace("://", "").split("/")[0]);
921921
if ((external == true || capture == false) && target.getAttribute("data-ajax") != "true") return;
922922
}
923923

test/ajax-html/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
<ul>
2626
<li><a href="b.html">连续加载测试-加载b页面</a></li>
2727
</ul>
28+
<ul>
29+
<li><a href="http://www.zhangxinxu.com/sp/char.html" target="_blank">外部地址测试,应该直接跳转</a></li>
30+
</ul>
2831
<ul>
2932
<li><a href="../index.html" data-ajax="false">&laquo; 返回测试引导首页</a></li>
3033
</ul>

0 commit comments

Comments
 (0)