Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
i am calling an api on click of a button. the issue is that the code works as expected in crome while it doesn't in firefox. I checked that there is no error in console in firfox.

Intresting thing is that if i have firefox develper tool opened in the browser then the request is hitting the controller , however if i close the developer tool and then make a request , it's not hitting the controller actionmethod

What I have tried:

<script type="text/javascript">
		$(document).ready(function () {
			$(document).off('click', '.btnSave').on('click', '.btnSave', function (e) {
				$.post("/api/ReturnRequestApi", { ReturnRequestId: $("#Id").val(), ReturnRequestStatusId: $("#ReturnRequestStatusId").val() })
				.done(function (data) {
					
					window.location.href = "/Admin/ReturnRequest/List";
				});
			});
		});
	</script>
Posted
Updated 13-Mar-17 17:03pm
v3
Comments
Bryian Tan 10-Mar-17 15:54pm    
what doesn't work?
ujjwal uniyal 13-Mar-17 20:41pm    
api is not being called if i am using firefox as my browser , however in case of crome and ie there is no issue.
j snooze 10-Mar-17 17:13pm    
there is a firebug add in to firefox that lets you debug javascript. You might want to try that to see if that helps you spot anything.
ujjwal uniyal 13-Mar-17 21:41pm    
firebug is of no use here. it is not even able to detect if there is a script on page. only through developer tools i can see this.
Bryian Tan 14-Mar-17 1:28am    
hmm, that odd. What version of Firefox you using?
On Firefox, did you see any error message on the Console tab? Press F12, click on the console tab and then trigger the API call. Check the Network tab also

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900