?
Solved

how do i update my ajax code to the latest version of jquery min?

Posted on 2014-08-12
4
Medium Priority
?
495 Views
Last Modified: 2014-08-18
Hi

I hope you can help me with this issue:

I have this code:
        <script type="text/javascript">
		
$(function() {
$(".busqueda").click(function(){

                    $.ajax
                    ({
                        type: "POST",
                        url: "ajax.php",
						data: 'page=1',
                        success: function(msg)
                        {
                            $("#dos").ajaxComplete(function(event, request, settings)
                            {
                                $("#dos").html(msg);
                            });
                        }
                    });
});
});		
        </script>

Open in new window


it works without problems when I use this version of jquery min: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

But It doesnt works when Im trying to use the latest version of jquery min (<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>)

I hope you can tell me what part of my code I need to change to make it compatible to the latest version of jquery min.

Best regards
0
Comment
Question by:altariamx2003
  • 3
4 Comments
 
LVL 58

Assisted Solution

by:Gary
Gary earned 2000 total points
ID: 40257506
Hard to tell from what you have posted and it's a long time since I used that version

Is the element with the class busqueda a dynamic element?
If so then use

$(document).on("click",".busqueda",function(){

Do you have a link to the page?
0
 

Author Comment

by:altariamx2003
ID: 40258441
nop, busqueda is a static element
0
 

Accepted Solution

by:
altariamx2003 earned 0 total points
ID: 40258445
but thanks anyway for you time gary, I found the solution ( I think hehehehehe)

With a few changes this is working with the last version of jquery min

        <script type="text/javascript">
		
$(function() {
$(".busqueda").click(function(){

                    $.ajax
                    ({
                        type: "POST",
                        url: "ajax.php",
						data: {
                           inicial : $('#inicial').val(),
			               final: $('#final').val()
                        },
                        success: function(msg)
                        { $("#dos").html(msg); }
                    });
});
});		

        </script>

Open in new window

0
 

Author Closing Comment

by:altariamx2003
ID: 40267262
I foun the solution by myself
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses
Course of the Month17 days, 8 hours left to enroll

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question