我有一个在每个视图中加载的标题视图。我在标题视图中有一个 jquery 函数,并想在另一个视图 jquery 函数中使用该 jquery 函数。
标题查看jquery函数:
$('#myAccount').click( function() {
loadPopupBox();
$('.login_pop_right').fadeTo('slow',1);
$("#mdhemadd").attr('disabled',false);
$("#mdhpass").attr('disabled',false);
});
我想访问它的另一个视图 jquery 函数:
$('#shortlist').click(function(){
var userid = $('#userid').val();
var dealid = $('#dealid').val();
if(userid!=''){
$.ajax({
type: "POST",
url: "/packagedetails/shortlistdeal",
data: "userid=" + userid+"&dealid="+dealid,
// data: form_data,
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj==true)
{
loadShortlistPopupBox();
$('#shortlistmsg').empty();
var html='<span class="messageicon"></span><p>Deal shortlisted sucessfullly.</p>';
$('#shortlistmsg').append(html);
// alert("Deal shortlisted sucessfullly");
}
else
{
loadShortlistPopupBox();
$('#shortlistmsg').empty();
var html='<span class="messageicon"></span><p>This deal cannot be shortlisted.Please check your account for your <a href="/myaccount">shortlisted deals</a>.</p>';
$('#shortlistmsg').append(html);
// alert("This deal cannot be shortlisted.Please check your account for your shortlisted deals.");
}
}
});
}
else
{
alert("sd");
$('#myAccount').click();
}
});
怎么做?
谢谢,