1
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?

user3327101
  • 171
  • 1
  • 3
  • 8

1 Answers1

2

Sure. Don't use document.write.

var s = document.createElement('script');
s.src = y;
document.body.appendChild(s);
Niet the Dark Absol
  • 320,036
  • 81
  • 464
  • 592