Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2012
    Posts
    57
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Exclamation What's wrong with this Ajax code?

    Hi, I am using jquery ajax to send info to a certain url: profile.php

    Even though there is nothing wrong with it, according to my browser's inspect element, it doesn't put an alert, which means that the code doesn't get through.

    Can anyone help me fix this code??



    Code:
    //AJAX STUFF
    
          $(document).ready(function()
          
          {
          
          $('#bluebgradio').click(function()
          
          {
          
          $.ajax(
          
          {
          
          type: "POST",
          
          url: profile.php,
          
          data: {blueBGhas: "yes"}})
    
          .done(function() 
    
          {
    
          alert("Hello");
    
          });
    
          });
    
          });

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    3,762
    Thanks
    23
    Thanked 548 Times in 547 Posts
    Code:
    url: "profile.php",

  • #3
    New Coder
    Join Date
    Jun 2012
    Posts
    57
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Yes!

    Thank you so much that one error caused the problem thank you!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •