?
avatar MartinTop
MartinTop
23 Mar 2015

Steps to reproduce the issue

  1. Create a function in a controller.
  2. Add JPluginHelper::importPlugin( 'yoodiy' ); to it
  3. Output a json encoded string
    $document->setMimeEncoding('application/json');
    echo json_encode('myresult');
    
  4. Call the above function using ajax
  5. Ajax response contains a special character that prevents javascript from decoding the response.
Additional remarks
  1. Sample code available upon request
  2. We cannot trigger events from ajax calls

Votes

# of Users Experiencing Issue
2/2
Average Importance Score
5.00

avatar MartinTop MartinTop - open - 23 Mar 2015
avatar MartinTop MartinTop - change - 23 Mar 2015
Labels Removed: ?
avatar MartinTop
MartinTop - comment - 23 Mar 2015

Added screenshotsscreen shot 2015-03-23 at 06 43 46screen shot 2015-03-23 at 06 43 48


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6553.
avatar brianteeman brianteeman - change - 23 Mar 2015
Labels Added: ?
avatar heleneross
heleneross - comment - 24 Mar 2015

I am also having the same error - firefox reports json error, chrome says there is an extra <


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6553.
avatar Devportobello
Devportobello - comment - 25 Mar 2015

I'm unable to reproduce your issue, you need to provide more code.

What does your plugin?

Are you using some JS libraries? eg: Jquery

Moreover, i think you not use the proper way:
Use "JResponseJson" to handle the output, eg:
echo new JResponseJson(array('data'=>'test'),'Success');

In controller context you can use $this->input has place of JFactory::getApplication()->input

avatar MartinTop
MartinTop - comment - 26 Mar 2015

Hi Devportobello,

Thank you for your suggestions regarding code.

We've resolved the problem, one of our plugin's files was encoding in UTF8 With BOM.

Regards.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6553.
avatar brianteeman brianteeman - change - 26 Mar 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-03-26 10:09:40
Closed_By brianteeman
avatar brianteeman brianteeman - close - 26 Mar 2015

Add a Comment

Login with GitHub to post a comment