Hi guys, I just started with Laravel a couple of weeks ago. I've create an application which uses the component datatables.net to load information via Ajax. It works fine on the computer. But in my phone if I open it using 3G connection it fails! Datatable throws an exception about Invalid JSON, I inspected the page and the response is this HTML:
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>* Error *</title>
<!--
Change href="style.css" below to the file name and
relative path or URL of your external style sheet.
-->
<!--
<link rel="stylesheet" href="style.css" type="text/css"/>
<style> document-wide styles would go here </style>
-->
</head>
<body>
<h1>Sorry</h1>
<ul>
The requested item could not be loaded!<br/>(Status Code: 500)
</ul>
</body>
</html>
The strange thing is that it works fine if I access over wi-fi. Another thing is that there's another page which also uses datatables.net and it works fine both over 3G and wi-fi! Does anyone have idea what might be the problem? Thanks.
500 Internal Server Error i cant see any code to help :D
See if it fails on your computer using 3g. If it does have a close look at the requests being sent in your chrome inspector and try to log the requests being receive on your server and compare the two. Some 3g providers add some nasty caching to your requests which can mess with the headers and even content. I've dealt with a few ajax errors that were only found on Vodafone.
Thanks for you reply guys.
Yeah, it fails as well from the computer....I compared both headers using 3G and wi-fi and the Status code is '200 OK' for both, but I've noticed a few differences:
Request Headers: In the 3G request it has 'Cache-Control:max-age=0' while in the wi-fi I don't have it;
Response Headers: 'Connection:' in 3G is 'close' while in wi-fi is 'Keep-Alive', and I think that because of that in the wi-fi I have the following data which I don't have in 3G: 'Keep-Alive:', 'Server:', 'Set-Cookie:', 'Transfer-Encoding:' and 'X-Powered-By:'.
Anything that might be related to the problem?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community