I want to show in an alert a french sentence containing accentuated letters such as "é" and "à". So I use the utf-8 charset in the meta tag of my php file so that the letters "é" and "à" are displayed normally in a javascript alert. The problem is that when getting the ajax responseText then I get among the responses the code of the meta tag. So how to get only the echo result of the php file ?
Here is the php file used by the ajax :
<?php
define("ROOT_PATH", "../../");
include ROOT_PATH . 'config.ajax.php';
include ROOT_PATH . 'config.inc.php';
require_once RP_MODELS.'produit.class.php';
$prod_code = $_GET['prod_code'];
$db =& new DbConn() ;
$produit =& new produit($db->getInstance()) ;
$tab = $produit->lire($prod_code) ;
if ( $tab['cnt'] > 0)
$rep = "Le code produit " . $prod_code . " existe déjà !" ;
else
$rep = "0" ;
echo $rep;
?>
So I want only the $rep variable to be returned by the ajax responseText. How to achieve that ?
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)