2012-04-13 11 views
0

私は、HTML側ではFacebookやTwitterでリンクを共有するため、次のJavaScriptコード....プロフィールのリンクの共有やTwitter

<script type="text/javascript"> 
function show_fb(id) 
{ 

alert('http://www.facebook.com/sharer.php?u= 
http://devel.testingsite.biz/testxxxxx.php?cmd=profile&id='+id+''); 

u=location.href; 
t=document.title;window.open('http://www.facebook.com/sharer.php?u={https_server}testxxxxx.php?cmd=profile&id='+id+'','sharer','toolbar=0,status=0,width=626,height=436'); 
return false; 
} 
</script> 

そのように

<li><a href="javascript:void(0)" onclick="show_fb({uid});" class="icon_h3"></a></li>

として示されています

まあ機能が働いていると、それは、共有ウィンドウを示していますが、私は共有するようになったリンクは、IDのないものである

http://devel.testingsite.biz/testxxxxx.php?cmd=profile

しかし、アラート機能で表示される同じリンクは、ID(下に示す)を示します。次のリンクを生成する必要があります。

http://devel.testingsite.biz/testxxxxx.php?cmd=profile&id=645

答えて

0

あなたはこれを試すことができます私の機能のいずれかの間違いがありますか?

<script type="text/javascript"> 
function show_fb(id) 
{ 

alert("http://www.facebook.com/sharer.php?u= 
http://devel.testingsite.biz/testxxxxx.php?cmd=profile&id='+id+'"); 

u=location.href; 
t=document.title; 
window.open("http://www.facebook.com/sharer.php?u={https_server}testxxxxx.php?cmd=profile&id='+id+'','sharer','toolbar=0,status=0,width=626,height=436"); 
return false; 
} 
</script> 
+0

なしchannge Infactはそれが新しいタブで開く開始 – Nabe

+0

window.open( "http://www.facebook.com/sharer.php?u={https_server}testxxxxx.php?cmd=profile&id=」 + id + '、' sharer '、' toolbar = 0、status = 0、width = 626、height = 436 '); – Ali

+0

全くありません..... – Nabe

関連する問題