message system and AJAX

5 years 6 months ago #9318 by llorca
llorca created the topic: message system and AJAX
I want to send a system message, using JAVASCRIPT. The parameters are 'the message' and 'message type'.
So I created the PHP code and JAVASCRIPT code. nothing happens.
Variables are OK and tested to $message and $type.
there 's no errors in execution.
if someone has an idea. thank you. :P

code PHP:

// envoyer un message en utilisant les messages système joomla
$message= $_GET;
$type= $_GET;
define('_JEXEC', 1 );
define('JPATH_BASE', $_SERVER);
require_once(JPATH_BASE .DS.'configuration.php');
require_once(JPATH_BASE .DS.'includes'.DS.'defines.php');
require_once(JPATH_BASE .DS.'includes'.DS.'framework.php');
require_once(JPATH_BASE .DS.'libraries/loader.php');
require_once(JPATH_BASE .DS.'libraries/joomla/factory.php');

JLoader::import( 'joomla.factory');
$app = JFactory::getApplication('site');
$app->enqueueMessage($message, $type);

echo true;



function messageInfo(message,type){

if (ajax)

//url pour récupérer la commune dans la table AEan_communes en fonction du CP
var url = "scripts/message.php";
var param = "?message=" + escape(message) + "&type=" + escape(type);"GET", url + param, true);
ajax.onreadystatechange = function() {
if (ajax.readyState == 4 && ajax.status == 200) {
essai = ajax.responseText;



Please Log in or Create an account to join the conversation.

5 years 6 months ago - 5 years 6 months ago #9325 by marcin
marcin replied the topic: message system and AJAX

System messages in Joomla are sensitive issue.
You can look for some ready solutions at Joomla Extensions Directory:

If you want us to deeply test and fix your code, you will need to contact our customization department via tickets for a quote.

Last Edit: 5 years 6 months ago by marcin.

Please Log in or Create an account to join the conversation.

Time to create page: 0.218 seconds


ul. Wałowa 10/3, 84-200 Wejherowo, registered in Centralna Ewidencja i Informacja o Działalnosci Gospodarczej
NIP/VATID: PL5882424318

Copyright © 2009-2021 All rights reserved. and this site is not affiliated with or endorsed by The Joomla! Project™. Any products and services provided through this site are not supported or warrantied by The Joomla! Project or Open Source Matters, Inc. Use of the Joomla!® name, symbol, logo and related trademarks is permitted under a limited license granted by Open Source Matters, Inc.