11-04-2016, 09:17 AM
So I have built 3 ajax scripts that return some values from my database.
However, whenever I run these ajax calls, they all return the same response:
data returned:
--------------
<script>
// Place analytics code here
</script>
Case 1:
If I don't set a response, a response is sent anyway with the above data.
Case 2:
If I set a response eg. echo "test"; then the following response is received:
data returned:
--------------
<script>
// Place analytics code here
</script>
test
Case 3:
If I don't include init.php then the ajax calls behave as they should.
Obviously something is wrong here, because the only file i'm including is init.php
Conclusion:
So I went to /users/helpers/us_helpers.php and commented out line 22:
//require_once $abs_us_root.$us_url_root.'usersc/includes/analytics.php';
And the problem looks fixed for now.
However, whenever I run these ajax calls, they all return the same response:
data returned:
--------------
<script>
// Place analytics code here
</script>
Case 1:
If I don't set a response, a response is sent anyway with the above data.
Case 2:
If I set a response eg. echo "test"; then the following response is received:
data returned:
--------------
<script>
// Place analytics code here
</script>
test
Case 3:
If I don't include init.php then the ajax calls behave as they should.
Obviously something is wrong here, because the only file i'm including is init.php
Conclusion:
So I went to /users/helpers/us_helpers.php and commented out line 22:
//require_once $abs_us_root.$us_url_root.'usersc/includes/analytics.php';
And the problem looks fixed for now.