[jQuery] javascript

[jQuery] javascript

<div>hi i am new to javascript language </div><div>
</div><div>i written a script and it works fine and i modified it a bit </div><div>and it is not working .</div><div>
</div><div>i don't know why this is not working but the later is working well</div>
<div>please tell me what is wrong with this</div><div>
</div><div>// not working</div><div><div><div>SocialSite.Home.UserInfo =</div><div>{    </div><div>   options : {</div><div>       beforeSubmit: this.friendRequest,</div>
<div>        success:  this.friendResponse</div><div>   },</div><div>    </div><div>    friendRequest : function(formData, jqForm, options)</div><div>    {</div><div>    },   </div><div>    friendResponse : function (responseText, statusText) {</div>
<div>    }</div><div>};</div></div><div>
</div><div>$(document).ready(function() {</div></div><div>$('#addasfriendform').ajaxSubmit(SocialSite.Home.UserInfo.options);</div><div>};</div><div>
</div><div>
</div>
<div>// working</div><div><div>SocialSite.Home.UserInfo =</div><div>{    </div><div>    friendRequest : function(formData, jqForm, options)</div><div>    {</div><div>    },   </div><div>    friendResponse : function (responseText, statusText) {</div>
<div>    }</div><div>};</div></div><div>
</div><div>$(document).ready(function() {</div><div>    var  options = {</div><div>        beforeSubmit: SocialSite.Home.UserInfo.friendRequest,</div><div>        success:  SocialSite.Home.UserInfo.friendResponse</div>
<div>    };</div><div><div>$('#addasfriendform').ajaxSubmit(options);</div><div>};</div></div>