Please let me know the equivalent of below prototype code in Jquery.
var myAjax = new Ajax.Updater('abc', '/billing/add_bill_detail', {
method: 'get',
parameters: pars,
insertion: Insertion.Bottom
});
I want to perform the same action using Jquery.
Thanks in Advance.
In jQuery the Ajax will use as following:
Use #abc if abc is the id of the div or use .abc if abc is a class.
You can place the returnData iin your HTML where you want,
There are some ways using ajax like
jQuery.ajax({...}) or $.ajax({...})
other than this there are some simplified versions of these too like:$.get()
orjQuery.get()
$.post()
orjQuery.post()
$.getJSON()
orjQuery.getJSON()
$.getScript()
orjQuery.getScript()
$ = jQuery
both are same.As you are using
method : 'get',
so i recommend you to use$.ajax({...})
or$.get()
but remember to include jQuery above this script otherwise ajax function wont work Try to enclose the script in the$(function(){})
doc ready handler.'abc'
if you could explain itTry adding this with
$.ajax()
:or with
$.get()
:or more simply use the
.load()
method:You can use .load() method
Read docs: http://api.jquery.com/load/