File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes How Can I Show a jQuery dialog after a hyperlink has been clicked Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How Can I Show a jQuery dialog after a hyperlink has been clicked" Watch "How Can I Show a jQuery dialog after a hyperlink has been clicked" New topic
Author

How Can I Show a jQuery dialog after a hyperlink has been clicked

Ravish Srivastava
Greenhorn

Joined: Sep 05, 2011
Posts: 21
Hi,

How can I show a JQUERY dialog after a hyperlink has been clicked. The Dialog has a button say "Ok". If I press a button "Ok", the request should go to link mentioned.

Below is the my JQUERY CODE inside my JSP:

$(document).ready(function(){
$( "#dialogform1" ).dialog({
autoOpen: false,
height: 300,
width: 450,
resizable: false,
buttons: {
"Ok": function(){
$(this).dialog('close');
window.location.href = link.attr('href');
}
}
});

$('#opener').click(function(){
$('#dialogform1').dialog("open");
});


HTML link Code in JSP:
<a id="opener" href="google.com">Download Item List</a>

When i click the above link, i should get a POP up having "Ok" button and when i press the "Ok" button google.com link sholud open and pop should close otherwise my pop reamins open.


RS



Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
The code

needs to be inside the document.ready function.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How Can I Show a jQuery dialog after a hyperlink has been clicked
 
Similar Threads
Grails Tutorials Available.
Value in the textarea is not retaining in jquery popup modal.
Jquery Event Sequence
How to display the popup on the button click using Jquery
Creating a masked popup in JavaScript