2011-02-09 73 views
1

我正在做一個書籤到我的網站,而現在我有:我需要什麼才能在彈出窗口或新窗口中打開它?

<a href="javascript:location.href='http://website.com/compartir_link.php?url='+encodeURIComponent(location.href)" >Save this</a> 

至極工作正常,問題是當我嘗試在新標籤中打開它:這就像當我嘗試保存:約:空白(在Firefox)

,我希望能夠做到這一點沒有失去我目前的視頻,這就是爲什麼我thouhgt約poput,但funcionally目標=「_空白」會爲我工作,

有什麼建議嗎? 非常感謝你!

PD:這個鏈接將被保存在我的瀏覽器書籤(也許在我的其他webistes),像Facebook這樣的書籤/共享者

編輯

您的答覆後,我有這個/ JS /文件。 js

jQuery("body").ready(function(){ 
jQuery(".keep_btn").click(function(event) { 
    event.preventDefault(); 
    if(this.href=""){ 
     this.href=document.URL; 
    } 
    window.open("http://website.com/API/public/compartir_link.php?url="+this.href,'about to keep', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=450,height=400'); 
}); 

});

,我可以在一個IFRAME方含現在使用它:

<a class="keep_btn" href="#" style="background-color:red;color:white;">keeps</a> 

這對我(使用外部網站鏈接的情況下)所需要的工作

但如何我可以用它在常規所以我可以把它保存到我的瀏覽器?

我最誠摯的問候

回答

2

JavaScript調用...

從鏈接:

<a href="#" onClick="openIt();return true">Click Here to Open</a> 

從形式的按鈕:

<input type="button" value="Open the Window" onclick="openIt()" /> 


function openIt() { 
    w=window.open(linkUrl, reportName, "resizable=yes, directories=no,location=no,menubar=no,status=no,titlebar=no,toolbar=no,top=50,height=600, width=900"); 
}