In my project,iam passing file path as a parameter to a javascript function.
On replacing the separator with escape character, iam passing this parameter to another function that is called in my previous function.
But in my second function, iam getting the blank spaces without the separator.
On replacing the separator with escape character, iam passing this parameter to another function that is called in my previous function.
But in my second function, iam getting the blank spaces without the separator.
Code:
function linkFolderHTML(isTextLink) { var docW = ""; var str =this.hreference; //PATH "E:\XX\test"; var xy = str.replace('\\','\\\\'); if (this.hreference) { if (USEFRAMES) // docW = docW + "<a href='" + this.hreference + "' TARGET=\"_self\" " docW = docW + "<a href='javascript:ajaxDisplay(\""+xy+"\",\""+this.getID()+"\")' TARGET=\"_self\" " else // docW = docW + "<a href='" + this.hreference + "' TARGET=\"_self\" " docW = docW + "<a href='javascript:ajaxDisplay(\""+xy+"\",\""+this.getID()+"\");' TARGET=\"_self\" " if (isTextLink) { docW += "id=\"itemTextLink"+this.id+"\" "; } docW = docW + ">" } else docW = docW + "<a>" return docW; } function ajaxDisplay(path,id) { alert(path); //iam getting "E:XX test" searchReq.open('GET','../jsppages/displaylist.jsp?path='+pathx); // searchReq.open('GET','../jsppages/treeview.jsp?mode=display&path='+pathx); searchReq.onreadystatechange = function() { DisplayReply(divid); }; searchReq.send(null); }
Comment