0
我試圖做的是在twitter上共享標籤文本值作爲url鏈接,但它不按預期工作。什麼錯我的代碼..從數據庫生成用asp.net中的標籤文本替換href值
我的標籤值:
<asp:Label ID="lblReferralURL" runat="server" Text="" ForeColor="Blue" Font-Bold="true"></asp:Label>
<a href="https://twitter.com/intent/tweet?url=https://google.com" id="TwitterLink" class="twitter" onclick="window.open(this.href, 'mywin','left=300,top=100,width=650,height=500,toolbar=1,resizable=0'); return false;">Tweet New</a>
$(document).ready(function() {
var para = $('#cphPage_lblReferralURL').html();
$('#TwitterLink').attr('href', function() {
return this.href + '?url=' + para;
});
});