mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-27 04:20:22 +08:00
warn on error when user display javascript
This commit is contained in:
parent
5c394dab71
commit
33edba2c9a
@ -360,7 +360,19 @@ var IPython = (function (IPython) {
|
|||||||
container.hide();
|
container.hide();
|
||||||
// If the Javascript appends content to `element` that should be drawn, then
|
// If the Javascript appends content to `element` that should be drawn, then
|
||||||
// it must also call `container.show()`.
|
// it must also call `container.show()`.
|
||||||
eval(js);
|
try {
|
||||||
|
eval(js);
|
||||||
|
} catch(err) {
|
||||||
|
console.log('Error in Javascript!');
|
||||||
|
console.log(err);
|
||||||
|
container.show();
|
||||||
|
element.append($('<div/>')
|
||||||
|
.html("Error in Javascript !<br/>"+
|
||||||
|
err.toString()+
|
||||||
|
'<br/>See your browser Javascript console for more details.')
|
||||||
|
.addClass('js-error')
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user