-4

I'm trying to url-encode...How do I this? this syntax is wrong ...

Here is my code:

   <div class="post-btn-share">
<div class="addthis_toolbox addthis_default_style">
    <div class="float-all">
        <script>
            var url = urlencode('http://mypage.com/visualizar_foto.php?img=55&user=2&xx=');
            alert(url);
            </script>
        <iframe src="http://www.facebook.com/plugins/like.php?href=" + url + "&send=true&layout=standard&width=300&show_faces=true&action=like&colorscheme=light&font&height=80" frameborder="0" style="border:none;" scrolling="no" width="320" height="240"></iframe>
        <div class="float-all">

        </div>
        <div class="float-all">

        </div>
    </div>
4

2 回答 2

2

Try with :

var url = encodeURIComponent('http://mypage.comvisualizar_foto.php?img=55&user=2&xx=');
于 2013-04-18T14:10:51.587 回答
0
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode('http://mypage.com/visualizar_foto.php?img=55&user=2&xx='); ?>&send=true&layout=standard&width=300&show_faces=true&action=like&colorscheme=light&font&height=80" frameborder="0" style="border:none;" scrolling="no" width="320" height="240"></iframe>
于 2013-04-18T14:34:26.120 回答