Closed (fixed)
Project:
Morse
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
10 Oct 2011 at 03:53 UTC
Updated:
4 Jan 2012 at 10:40 UTC
In general, you should never use eval(). AJAX calls should return data, not logic. More specifically echo "$('#status').html('<b>The morse code is : ". $output ."</b>');"; should be more like drupal_json(array('morse' => $output)); And eval(msg); should be more like var response = $.parseJSON(msg); $('#status').html('<b>The morse code is : ' + response.morse + '</b>'); (This is untested code, but should give you the general idea.)
Comments
Comment #1
prathK commentedRemoved the eval function and javascript itself to avoid any ambiguity.
Committed the changes in new version 2.x