function OpenWindow(anchor) {
var toUsername = anchor.innerText;
window.open("ChatWindow.aspx?username=" + toUsername,'_blank', "width=340,height=200");
}
this function opens up a page with parameter as undefined in firefox where as in google chrome I get proper value.
Firefox url:
http://localhost:9452/ChatWindow.aspx?username=undefined
What is the solution for this issue?
While
innerTextis non-standard, it significantly differs fromtextContent, because first one is doing pretty printing (for example,<br/>are converted to new lines), while second one – is not.So, while common wisdom is to use:
or some kind of wrapper, it can probably be smarter to just use jQuery’s
.textor its analog from other library you are using.