0

大家好,我有一个btnfb,如果您单击提要对话框,则会出现并在 facebook 上分享。fb.ui { link: }但是我给我时出错了error 500 internal server error

如果link"http://localhost:3001/campaigns/tracker/123BCDSLKF"代码是好的。但是如果linkhttp://localhost:3001/campaigns/tracker/"+tracker-> 我dynamic让它给了我错误。

$(function(){
                $('#btnfb').click(function(e){
                    e.preventDefault();
                    var tracker = generate_tracker();
                    <?php $tracker = generateRandomString(); ?>
                    FB.ui({
                        method: 'feed',
                        name: 'Test title',
                        link: "http://localhost:3001/campaigns/tracker/"+tracker,
                        picture: 'my_picture_link',
                        caption: 'Test caption',
                        description: 'test description',
                    }, requestCallback);
                });
            });

跟踪器生成器:

function generate_tracker(){
         var text = "";
         var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

         for( var i=0; i < 10; i++ ){
             text += possible.charAt(Math.floor(Math.random() * possible.length));
          }

         return text;
     }

提前致谢。

4

0 回答 0