Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wangshusheng
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
ccbikai
9 years ago
Commit
16fda8a4b38a37fc50441e5b48c43e86533c6e88
1 parent
7674a650
修改头像加载失败检测方法
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
static/js/me/index.js
static/js/me/personal-details.js
static/js/me/index.js
View file @
16fda8a
...
...
@@ -4,9 +4,11 @@
* @date: 2015/11/12
*/
var
$
=
require
(
'jquery'
);
var
$userAvatar
=
$
(
'.user-avatar'
);
var
myImage
=
new
Image
();
require
(
'../product/recommend-for-you.js'
);
$
(
'.user-avatar'
).
on
(
'error'
,
function
()
{
$
(
this
).
attr
(
'src'
,
'http://static.dev.yohobuy.com/img/me/index/user-avatar.png'
);
});
\ No newline at end of file
myImage
.
src
=
$userAvatar
.
attr
(
'src'
);
myImage
.
onerror
=
function
()
{
$userAvatar
.
attr
(
'src'
,
'http://static.dev.yohobuy.com/img/me/index/user-avatar.png'
);
};
...
...
static/js/me/personal-details.js
View file @
16fda8a
...
...
@@ -4,7 +4,10 @@
* @date: 2015/11/19
*/
var
$
=
require
(
'jquery'
);
var
$userAvatar
=
$
(
'.user-avatar'
);
var
myImage
=
new
Image
();
$
(
'.user-avatar'
).
on
(
'error'
,
function
()
{
$
(
this
).
attr
(
'src'
,
'http://static.dev.yohobuy.com/img/me/index/user-avatar.png'
);
});
\ No newline at end of file
myImage
.
src
=
$userAvatar
.
attr
(
'src'
);
myImage
.
onerror
=
function
()
{
$userAvatar
.
attr
(
'src'
,
'http://static.dev.yohobuy.com/img/me/index/user-avatar.png'
);
};
...
...
Please
register
or
login
to post a comment