Magnific-Popup icon indicating copy to clipboard operation
Magnific-Popup copied to clipboard

ajax load results in 404 error

Open mmjaeger opened this issue 7 years ago • 3 comments

Hello my Ajax call results in a 404 error - obviously my url is wrong - what I was wondering though is how to catch this error and maybe show an error message in the popup.

thanks

mmjaeger avatar Dec 11 '16 22:12 mmjaeger

How are you performing your request? If you're using jQuery, it has a fail() function for handling anything that isn't a success state code (including redirects). See https://api.jquery.com/deferred.fail/ and https://api.jquery.com/jQuery.get/ for some examples.

tiesont avatar Dec 11 '16 23:12 tiesont

I just set the type argument to "ajax" - something like $( '.container' ).magnificPopup({type: 'ajax', delegate: 'selector')} - still don't understand how I could catch a 404

On Sun, Dec 11, 2016 at 4:34 PM, Tieson Trowbridge <[email protected]

wrote:

How are you performing your request? If you're using jQuery, it has a fail() function for handling anything that isn't a success state code (including redirects). See https://api.jquery.com/deferred.fail/ and https://api.jquery.com/jQuery.get/ for some examples.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dimsemenov/Magnific-Popup/issues/931#issuecomment-266317079, or mute the thread https://github.com/notifications/unsubscribe-auth/ABe4lL40jso8Zy_2icle4NxD0enBzzHaks5rHIh5gaJpZM4LKDX1 .

-- Marco M. Jaeger http://net4visions.com

mmjaeger avatar Dec 12 '16 12:12 mmjaeger

4 yrs later, I need this too...

stesvis avatar Nov 19 '20 17:11 stesvis