Example #1
0
        $field3 = isset($_REQUEST['field3']) ? $_REQUEST['field3'] : '';
        $response = 'Field 1 = "' . htmlentities(stripslashes($field1)) . '"<br/>' . 'Field 2 = "' . htmlentities(stripslashes($field2)) . '"<br/>' . 'Field 3 = "' . htmlentities(stripslashes($field3)) . '"<br/>';
        jQuery('#testform')->html($response);
        break;
    case 'timeout':
        sleep(3);
        jQuery('#preview_content')->animate(array('opacity' => '0.5'), 1000)->animate(array('opacity' => '1'), 1000);
        break;
    case 'msg':
        jQuery::addMessage('Message 1...');
        jQuery::addMessage('Message 2...');
        break;
    case 'msg2':
        jQuery::addMessage('Message 1...', 'myCallBack');
        jQuery::addMessage('Message 2...', 'myCallBack');
        break;
    case 'err':
        jQuery::addError('Error 1...');
        jQuery::addError('Error 2...');
        break;
    case 'data':
        jQuery::addData('key1', 'value1');
        jQuery::addData('key2', 'value2', 'myCallBack');
        break;
    case 'eval':
        jQuery::evalScript('alert("Eval script...");');
        break;
    default:
        break;
}
jQuery::getResponse();