By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,269 Members | 1,332 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,269 IT Pros & Developers. It's quick & easy.

Load content with AJAX and Fancybox

P: 1
I'm trying to load some content into a fancybox.

the code form HTML:

Expand|Select|Wrap|Line Numbers
  1. <form name="setdomainMarso" id="setdomainMarso" action="domains.php" href="#inline" method="post">
  2.     <input type="text" name="domain" class="formwww"/>
  3.  
  4.     <span class="Allwww" href="#inline">
  5.         <input type="submit" value="Recherche" class="submitwww" href="#inline"  />
  6.     </span>
  7. </form>
code AJAX is:

Expand|Select|Wrap|Line Numbers
  1. $.ajax({
  2.     type: 'POST',
  3.     url: 'domains.php',
  4.     data: $("#setdomainMarso").serialize(),
  5.     success: function(data) {
  6.         if(data == "Domain name is FREE!") {
  7.             $("#contact").fadeOut("fast", function(){
  8.                 $(this).before("<p><strong>Your domain is free</strong></p>");
  9.                 setTimeout("$.fancybox.close()", 1000);
  10.             });
  11.         }
  12.     }
  13. });
How can I load this content into my fancybox using AJAX?
Nov 2 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.