开发者

what do i need to open this in a popup or new window?

i'm making a bookmarklet to my website, and for now i have:

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

wich works fine, the problem is when i try to open it in a new tab: it's like when i try to save: about:blank (in firefox)

And i want to be able to do this without loosing my current video, that's why i thouhgt about a poput, but a funcionally target="_blank" will work for me,

any suggestion? thank you very mucho!

PD: this link will be saved as a bookmark in my Browser (maybe in my other webistes), Like facebook's bookmarklet/sharer

EDIT

After your replies i have this /js/file.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');
});

});

And i could use it now in a iframe containg:

<a class="k开发者_如何学Ceep_btn" href="#" style="background-color:red;color:white;">keeps</a>

Which works for what i need (in case using in an external website)

But how can i use it in a regular so i can save it to my browser?

My best regards


Javascript call...

From Link:

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

From a button in the form:

<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");
}


If you're looking for a "pop up", I suggest something like the jQuery UI Dialog.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜