If you go to and then e to stackoverflow and then open the console and type:
console.log( document.referrer );
You get
/
instead of
/
How can I get /
?
If you go to http://jsfiddle and then e to stackoverflow and then open the console and type:
console.log( document.referrer );
You get
http://fiddle.jshell/_display/
instead of
http://jsfiddle/
How can I get http://jsfiddle/
?
- 4 I think that is the correct referrer value - that's the way jsfiddle works. The "result" pane page is in that domain. – Pointy Commented Feb 11, 2013 at 17:42
1 Answer
Reset to default 6You get it because jsfiddle uses frames. Use window.frames.top.document.referrer
instead.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742402572a4437207.html
评论列表(0条)