0

嗨,我有一个页面,其中显示确认电子邮件后。我想在图片链接中显示该电子邮件。

为此,我使用了此代码,但我在这里得到了电子邮件变量 null。

<HTML>
<head>
<script type="text/javascript">
 var formData = function() {  var query_string = (location.search) ? ((location.search.indexOf('#') != -1) ? location.search.substring(1, location.search.indexOf('#')) : location.search.substring(1)) : '';  
var elements = [];  
if(query_string) {     
    var pairs = query_string.split("&");     
    for(i in pairs) {     
        if (typeof pairs[i] == 'string') {           
            var tmp = pairs[i].split("=");           
            var queryKey = unescape(tmp[0]);           
            queryKey = (queryKey.charAt(0) == 'c') ? queryKey.replace(/\s/g, "_") : queryKey;   
            elements[queryKey] = unescape(tmp[1]);      
             }    
       } 
 }  
return {     
    display: function(key) {         
        if(elements[key]) {           
             document.write(elements[key]);         
         } 
         else {         
               document.write("<!--If desired, replace everything between these quotes with a default in case there is no data in the query string.-->");          
          }     
  }   
} 
}
(); </script>
</head>
<body>
<!-- Offer Conversion: Safe Binary Trades -->
<script type="text/javascript">formData.display("email")</script>
<img src="http://mountainfallsmedia.go2cloud.org/SL22?adv_sub="email"    width="1" height="1" />

<!-- // End Offer Conversion -->
</body></HTML>

如果您查看您可以看到的最后几行代码formData.display("email"),它用于显示电子邮件,它工作正常,但它不工作的情况下

<img src="http://mountainfallsmedia.go2cloud.org/SL22?adv_sub="email"    width="1" height="1" />

我尝试通过传递formData.display("email")而不是email,但它仍然返回空白。

4

1 回答 1

0

我不确定你的问题到底是什么,或者你到底想要做什么,但你可能想要替换

src="http://mountainfallsmedia.go2cloud.org/SL22?adv_sub="email"

src='http://mountainfallsmedia.go2cloud.org/SL22?adv_sub="email"'

(请注意封装您的网址的单引号。)

于 2013-07-31T20:28:43.740 回答