javascript - Why is location.hostname not consistent? -
i have asp.net mvc project, , in 1 of javascripts, calling location.hostname
when host application on mvc, on windows 7 & 8 pcs, able print out localhost/myapp
however, when hosted on windows server 2008 r2 pc, printed out localhost
without virtual directory name
why that? , how can display full url?
you might want use:
window.location.href
or
window.document.documenturi
Comments
Post a Comment