开发者

How does FaceBook manage to have popups that accept postbacks?

I wonder why all jQuery popups plugins don't accept postback.

But if you see FaceBook see all friends popup, you can do next & previous. And if you remark, there is a postback (I think) when you click next or previous.

Can someone give me a link or explain how they do that?

I have remarked too, that you can right click (open in new window) or click directly see all (direct click ==> popup, right clic开发者_如何学运维k ==> new page) on it.

How they do that?


The second part is easy - if you click on a link and it fires a JavaScript event, it can return false or similar to stop the default browser behaviour. Opening the link in a new tab (perhaps via middle click on Firefox) will not fire the event.

If jQuery is your flavour, then observe this...

$(function() {
    $('a').click(function(event) {
       event.preventDefault();
       alert('Hey, let\'s go to Example!\n\nOn second thoughts, we won\'t.');            
    });
});


If there are popups that are "posting back" to themselves then it's either in a iframe (doubtful) or using ajax to update the UI when a button is clicked. Most of these popups aren't your standard window.open() popups, but rather a modal dialog.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜