Concatenaci贸n en js y php
Estoy teniendo un problema con la concatenaci贸n en javascript +php. el c贸digo es el siguiente:
<?php
print("<script language="JavaScript">
function Asigna()
{
var posi = document.getElementById('Idioma').selectedIndex;
var CodIdioma= document.getElementById('Idioma').options[posi].value;
self.location.href="Noticias.php?" . "&CodIdioma=" + [CodIdioma] " . "&bandera=" +1;
}
</script>");
?>
El error me da en el self.location.href en la concatenaci贸n de CodIdioma y bandera.
Gracias!
<?php
print("<script language="JavaScript">
function Asigna()
{
var posi = document.getElementById('Idioma').selectedIndex;
var CodIdioma= document.getElementById('Idioma').options[posi].value;
self.location.href="Noticias.php?" . "&CodIdioma=" + [CodIdioma] " . "&bandera=" +1;
}
</script>");
?>
El error me da en el self.location.href en la concatenaci贸n de CodIdioma y bandera.
Gracias!
Hola,
en principio creo que te sobra el ampersand que tienes delante de CodIdioma=
Saludos
en principio creo que te sobra el ampersand que tienes delante de CodIdioma=
Saludos
<?php
print("<script language="JavaScript">
function Asigna()
{
var posi = document.getElementById('Idioma').selectedIndex;
var CodIdioma= document.getElementById('Idioma').options[posi].value;
var url="Noticias.php?CodIdioma=" + CodIdioma + "&bandera=" +1;
self.location.href=url;
}
</script>");
?>
SALUDOS!!! ( jjaimevera )
print("<script language="JavaScript">
function Asigna()
{
var posi = document.getElementById('Idioma').selectedIndex;
var CodIdioma= document.getElementById('Idioma').options[posi].value;
var url="Noticias.php?CodIdioma=" + CodIdioma + "&bandera=" +1;
self.location.href=url;
}
</script>");
?>
SALUDOS!!! ( jjaimevera )
