Jquery Mobile 500 Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about
500 (internal Server Error) Jquery Post
hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges jquery ajax 500 internal server error php Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. 500 internal server error ajax get Join them; it only takes a minute: Sign up jQuery Ajax returns 500 internal server error on live server, fine on localhost up vote 0 down vote favorite I have a table which is filled from a database.
500 Internal Server Error Ajax Post Laravel
The user can delete one row by clicking the delete button next to it. After the click the row fades away. This works on my localhost but on the live server I get a 500 Internal server error. The strange thing is, there is a pretty much similar function tied to another element and that works fine. I simply copied the original one that was not written by me. I just wonder why on the live server the
500 Internal Server Error Ajax Post Mvc
original works and my identical code does not. Here is the my code: $K2('.deleteNakladyButton').click(function(event){ event.preventDefault(); if (confirm(K2Language[3])) { var element = $K2(this).parent().parent(); var url = $K2(this).attr('href'); $K2.ajax({ url: url, type: 'get', success: function(){ $K2(element).fadeOut('fast', function(){ $K2(element).remove(); }); } }); } }); The original is different in the name of the class that it is triggered by. The original says .deleteAttachmentsButton. This function is not crucial to the site but it would add a little bit more comfort for my client. Thank you for your answers. jquery ajax share|improve this question edited Aug 31 '12 at 17:34 dda 4,74411228 asked Aug 31 '12 at 17:32 Vojtech 3232824 4 A 500 internal server error should indicate to you that something is happening wrong on the server. –mittmemo Aug 31 '12 at 17:34 I know, but why is the original code working and my own is not since they are identical. –Vojtech Aug 31 '12 at 17:35 What is your url? Are you using php or asp.net? I have ran into this problem before. It turned out to be related to using the packaged server with Microsoft Visual Web Developer vs using IIS (Express). Once I changed over to IIS (Express), I was able to mimic a production server locally. –JoeFletch Aug 31 '12 at 17:36 @Vojtech, How should we know? You haven't posted any server-side code! –
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and post 500 (internal server error) policies of this site About Us Learn more about Stack Overflow the company
Failed To Load Resource: The Server Responded With A Status Of 500 (internal Server Error)
Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users jquery ajax error Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a http://stackoverflow.com/questions/12220049/jquery-ajax-returns-500-internal-server-error-on-live-server-fine-on-localhost minute: Sign up JQuery Mobile “Error Loading Page” on 404 and 500 up vote 4 down vote favorite 1 I would like jQuery mobile to navigate to pages if they are marked with 500 or 404. Is there a way to let jqm know that these pages are okay to navigate to? I have seen other solutions that redirect to a http://stackoverflow.com/questions/9447115/jquery-mobile-error-loading-page-on-404-and-500 404 page using $( document ).bind( "pageloadfailed") but I don't want to do this. I just want to display the 404\500 page generated by my PHP application. Thanks. javascript php jquery-mobile http-status-code-404 share|improve this question edited Nov 18 '15 at 14:51 pnuts 33.9k63769 asked Feb 25 '12 at 19:05 Nathan 3583416 I think this will answer your question stackoverflow.com/questions/13622729/… –Brady Emerson May 18 '13 at 20:54 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote jQuery Mobile knows that HTTP Status Codes 404 & 500 are error codes and so will automatically execute its default error behavior unless you specifically tell it to do otherwise. The jQuery Mobile docs state about the pageloadfailed event: By default, after dispatching this event, the framework will display a page failed message and call reject() on the deferred object contained within the event's data object. Callbacks can prevent this default behavior from executing by calling preventDefault() on the event. So...the default behavior is to hijack your request and show its own "page failed message." The only way to get some
Team Conduct Brand Guide Donate jQuery API Documentation Download http://api.jquery.com/ajaxerror/ API Documentation Blog Plugins Browser Support search Search https://api.jquery.com/error/ jQuery API Documentation .ajaxError() Categories: Ajax > Global Ajax Event Handlers .ajaxError( handler )Returns: jQuery Description: Register a handler to be called when Ajax requests complete with an error. This is an Ajax internal server Event. version added: 1.0.ajaxError( handler ) handler Type: Function( Event event, jqXHR jqXHR, PlainObject ajaxSettings, String thrownError ) The function to be invoked. Whenever an Ajax request completes with an error, jQuery triggers the ajaxError event. Any and all handlers that have internal server error been registered with the .ajaxError() method are executed at this time. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. To observe this method in action, set up a basic Ajax load request. 1 2 3 <button class="trigger">Triggerbutton><div class="result">div><div class="log">div> Attach the event handler to the document: 1 2 3 $( document ).ajaxError(function() { $( ".log" ).text( "Triggered ajaxError handler." );}); Now, make an Ajax request using any jQuery method: 1 2 3 $( "button.trigger" ).on( "click", function() { $( "div.result" ).load( "ajax/missing.html" );}); When the user clicks the button and the
Team Conduct Brand Guide Donate jQuery API Documentation Download API Documentation Blog Plugins Browser Support search Search jQuery API Documentation .error() Categories: Events > Browser Events | Deprecated > Deprecated 1.8 | Removed .error( handler )Returns: jQueryversion deprecated: 1.8, removed: 3.0 Description: Bind an event handler to the "error" JavaScript event. version added: 1.0.error( handler ) handler Type: Function( Event eventObject ) A function to execute when the event is triggered. version added: 1.4.3.error( [eventData ], handler ) eventData Type: Anything An object containing data that will be passed to the event handler. handler Type: Function( Event eventObject ) A function to execute each time the event is triggered. This method is a shortcut for .on( "error", handler ). As of jQuery 1.8, the .error() method is deprecated. Use .on( "error", handler ) to attach event handlers to the error event instead. The error event is sent to elements, such as images, that are referenced by a document and loaded by the browser. It is called if the element was not loaded correctly. For example, consider a page with a simple image element: 1 <img alt="Book" id="book"> The event handler can be bound to the image: 1 2 3 4 5 $( "#book" ) .error(function() { alert( "Handler for .error() called." ) }) .attr( "src", "missing.png" ); If the image cannot be loaded (for example, because it is not present at the supplied URL), the alert is displayed: Handler for .error() called. The