I have an object say list in my html page,
EDIT based on comment: Here is my XML
<?xml version="1.0" encoding="utf-8"?>
<Root>
<Item>
<Property_Cat_ID>1</Property_Cat_ID>
<Property_Cat_Name>Buy</Property_Cat_Name>
</Item>
<Item>
<Property_Cat_ID>2</Property_Cat_ID>
<Property_Cat_Name>Rent</Property_Cat_Name>
</Item>
</Root>
THIS IS HTML
<div class="ddpan01">
<div class="ddBoxHold">
<div class="ddBox">
<asp:TextBox ID="txtCat" runat="server" Value="Buy" ReadOnly="true"></asp:TextBox>
<asp:HiddenField ID="hdnTypeId" runat="server" Value="0" />
<span></span>
</div>
<div class="ddList">
<div class="ddListData">
<ul>
</ul>
</div>
</div>
</div>
</div>
Script on page on DOM ready.
$("div.ddpan01 div.ddBoxHold").find("div.ddList").find("div.ddListData ul li").click(function () {
alert('click');
getValues(0); // function which does dynamic value assigning work to all my fields
})
$.ajax({
type: "GET",
url: "/Admin/Includes/XML/PropertyCategory.xml",
dataType: "xml",
success: function (xml) {
var count = 1;
$(xml).find('Item').each(function () {
var id = $(this).find('Property_Cat_ID').text();
var name = $(this).find('Property_Cat_Name').text();
if (count == 1) {
$("div.tabdpan02").find("div.ddpan div.ddpan01 div.ddBoxHold div.ddBox input:first").val(name);
$("div.tabdpan02").find("div.ddpan div.ddpan01 div.ddBoxHold div.ddBox input:last").val(id);
}
$("<li id=" + id + "></li>").html(name).appendTo($("div.tabdpan02").find("div.ddpan div.ddpan01 div.ddBoxHold div.ddList div.ddListData ul"));
count++
});
}
});
No in my head section of the Page we have called a file called effect.js which also has a click event.
below function is in effects.js file
$(".ddListData ul li").live('click', function () {
var htmlStr = $(this).html();
var hId = $(this).attr('id');
$(this).parent('ul').parent('div').parent('div').prev('.ddBox').find('input:first').val(htmlStr);
$(this).parent('ul').parent('div').parent('div').prev('.ddBox').find('input:last').val(hId);
$(this).parent('ul').parent('div').parent('div').hide(0);
})
My question is which function will execute first and how can i call my getValues(0);
as click event after executing my effect.js click function, only.
I hope i am able to explain, my question, it is to big and complicated to write and explain here.