views:

76

answers:

2

Hello guys,

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 click ==> new page) on it.

How they do that?

+2  A: 

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.');            
    });
});
alex
Thanks Alex,can u give me a simple script that i can test .
amourgh
Thanks again Alex.that works fine.
amourgh
@amourgh - be sure to accept this answer if it resolved your problem, it helps you in the long run to have a high accept rate.
Nick Craver
A: 

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.

Ryan Peters