Second time js function not working

Posted by Sekar.C under jQuery on 7/25/2014 | Points: 10 | Views : 2874 | Status : [Member] | Replies : 1
I have js file it have some functions
In my master page using .js file function
It working first time but if i click again that function not call in my master page
Note: “$.colorbox” function not call second time ,its undefiend

function loginpopupopen(ctrl) {
var baseurltoaccess = '<%=GetPageFullURL("~/CartService.asmx/IsUserLoggedIn",false) %>';
$.ajax({
type: "POST",
url: baseurltoaccess,
data: "{}",
contentType: "application/json; charset=utf-8",
success: function(response) {
var result = eval(response.d);
if (result.retmsg == "failure") {
var navigationurl;
if ($(ctrl).attr('navigationurl').indexOf('?') == -1)
navigationurl = $(ctrl).attr('navigationurl') + "?";
else
navigationurl = $(ctrl).attr('navigationurl') + "&";
//second time not call the "$.colorbox" its undefined
$.colorbox({ href: $('input[type=hidden][id$=hfhostname]').val() + "/" + navigationurl + "signin=1", opacity: 0.4, initialWidth: "250", initialHeight: "180", scrolling: false });
}
else
location.href = location.href;
},
dataType: "json"
});

}


Regards
Sekar.c



Responses

Posted by: Vuyiswamb on: 7/25/2014 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
Do you get an Error when you check the browser console.

Thank you for posting at Dotnetfunda
[Administrator]

Sekar.C, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response