Change this...
var string = document.location;
to this...
var string = document.location + '';
This is because document.location
is a Location object. The default .toString()
returns the location in string form, so the concatenation will trigger that.
You could also use document.URL
to get a string.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…