I have the following span element defined in the view in the MVC app
<span id="openDocument"
class="fa fa-sign-in"
style="cursor:pointer;
color:#5d9cec"
data-toggle="tooltip"
onclick="openDocument(@item.formattedReference.ToString())")>
</span>
Javascript function:
function openDocument(documentId) {
debugger;
window.open("https://somelongURL/documentId=" + documentId);
};
The problem that I am having with this code is that this code works for document id that has numbers (eg. 12345) but it doesn't work for alphanumeric numbers (eg. R12345).
It gives me an error saying: Uncaught Reference Error: R12345 is not defined.
How do i solve this problem?
Thanks in advance.