Embed Ajax Call function to wordpress plugin


Staff member
Following code is making call to a file ajax.php and it working perfectly on my localhost.
I want to use this Ajax code in my wordpress plugin but I could not figure it out in Wordpress format. I even study codex.wordpress.org but could not find it helpful.
If anyone can do that Please Help me regarding this issue.

<script type="text/javascript">

function load_options(id,index){
$("#Year").html('<option value="">- Select Year -</option>');
url: "ajax.php?index="+index+"&id="+id,
complete: function(){$("#loading").hide();},
success: function(data)

<div style="width:800px; margin:auto;padding-top:100px;">
<select id="Make" onchange="load_options(this.value,'Model');">
<option value="">- Select Make -</option>
<select id="Model" onchange="load_options(this.value,'Year');">
<option value="">- Select Model -</option>
<select id="Year">
<option value="">- Select Year -</option>
<img src="loader.gif" id="loading" align="absmiddle" style="display:none;"/>

Please do guide / help me in this issue. I'm waiting for your good guidance / instruction regarding this issue.