最佳答案
                                        
                                                                        
                                如何使用JavaScript安全地对URL进行编码,以便将其放入GET字符串中?
var myUrl = "http://example.com/index.html?param=1&anotherParam=2";var myOtherUrl = "http://example.com/index.html?url=" + myUrl;我假设您需要在第二行编码myUrl变量?
 
                                
                             
                                
                             
                                
                             
                                
                             
                                
                             
                                
                             
                                
                             
                                
                             
                                
                             
                                
                             
                                
                             
                                
                             
                                
                             
                                
                             
                                
                             
                                
                             
                                
                             
                                
                             
                                
                             
                                
                            