Reputation: 191
function x(y){document.write('<script src="'+y+'" type="text/javascript"></script>')
Document.write can be a form of eval.
Got this message from jshint any idea how can solve the problem?
Upvotes: 1
Views: 4268
Reputation: 324750
Sure. Don't use document.write
.
var s = document.createElement('script');
s.src = y;
document.body.appendChild(s);
Upvotes: 2