有些符号在URL中是不能直接传递的,如果要在URL中传递这些特殊符号,那么就要使用他们的编码了
可以使用 encodeURIComponent方法进行编码
案例:
window.parent.frames.location.href=getRootPath()+"/terminalInfo/index.do?encryptedStr="+encodeURIComponent(encryptedStr)+"&sign="+sign+"&data="+encodeURIComponent(data)+"&pageType=I01";
本文介绍在URL中如何处理特殊字符,使用encodeURIComponent方法进行编码确保URL能正确传递信息。
1366

被折叠的 条评论
为什么被折叠?



