Do you mean in php.ini, or within the file that returns the json encoded data?
Main Topics
Browse All TopicsOk, this one has me well and truely stumped.
I have the following function that uses jquery to make ajax (json) requests:
function get_content_row(row_id) {
var session_var = "";
//alert(row_id);
var rethtml = $.ajax({
url: 'admin_json_functions.php'
success: function (j) {
session_var = j;
}});
return session_var;
}
When this function is called from within Javascript as follows:
var content_row = get_content_row(row_id);
alert(content_row['core'][
It works ok on my development server, but on my production server i get the following error:
Error: content_row.core is undefined
The JSON code that is called returns a json_encoded PHP array that is generated from a class and the code is as follows:
if ($_REQUEST['action'] == 'get_content_row' && isset($_SERVER['HTTP_X_REQ
function get_content_row($row_id) {
$resp = array();
$row = new content;
$row->load_content($row_id
$resp['core'] = $row->core;
$resp['category'] = $row->category;
$resp['author'] = $row->author;
$resp['media'] = $row->media;
$resp['taglines'] = $row->taglines;
$resp['keywords'] = $row->keywords;
//return arrayToJS($resp, 'content_row');
return $resp;
}
As I have mentioned, in my dev enviroment (apache 2.2, mysql 5+, php 5+) this all works ok, but in my production server it throughs this error. I understand this may stem back to problems with how the variable may be passed between php and javascript (using ajax as the carrier) and have investigated the following options:
* eval() clientside funciton
* Use of Hash structures and passing through that way.
However this is sort of not my point, what i was hoping to get to the bottom of, is why it may be workign on my dev server, and not production, as if this can be modified to work many, many potential changes to code may be avoided.
Thanks in advance, Jake.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: santoshrajanPosted on 2008-10-02 at 21:51:16ID: 22631226
Your production server may not be setting the header to application/x-json. set it in your php and try.