Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/06/2010, 12:06
churretin
 
Fecha de Ingreso: abril-2010
Ubicación: Extremadura
Mensajes: 128
Antigüedad: 14 años
Puntos: 2
a simple vista es lo mismo, pero....

hola amigos, traigo dos codigos k hacen los mismo, el primero funciona correctamente, me coje los datos de un array en javasacprt con todos los datos y todo perfecto, y en el sengudo pretenod kojer las informacion de una base de datos, aunk ahora para el caso las tengo en un arrays, pero no creo k eso importe micho al fin y alcabo el sql va a acaabar en un aarrays igual

lo k no me esplcio es por k el primero funciona perfectamente y el segundo no, el porblam esta en ela forma de hacer el arrays o algo, nose me toy volviendo loko:

os ponog primero el k funcionma bien

script type="text/javascript">
var aLocations = new Array();
var aTitles = new Array();
var aDetails = new Array();

aLocations = [
'keswick,cumbria,uk',
'grasmere,cumbria,uk',
'ambleside,cumbria,uk'
];
aTitles = [
'Keswick',
'Grasmere',
'Ambleside'
];
aSummary = [
'<h3>Keswick</h3><p>Keswick is a market town and civil parish within the Borough of Allerdale in Cumbria, England. It had a population of 4,984, according to the 2001 census.</p>',
'<h3>Grasmere</h3><p>Grasmere is a village, and popular tourist destination, in the centre of the English Lake District. It takes its name from the adjacent lake of Grasmere, and is associated with the Lake Poets.</p>',
'<h3>Ambleside</h3><p>Ambleside is a town in Cumbria, in North West England. Historically within the county of Westmorland, it is situated at the head of Windermere, Englands largest lake. The town is within the Lake District National Park.</p>'
];

$(document).ready(function() {
$('#test').GoogleMap(aLocations, aTitles, aSummary, {
type: 3,
zoom: 9
});
});


y ahora el no me fumciona:

<?php

$dir = array('calle sevilla, zafra, españa', 'calle garrotera, zafra, españa');
$nombre = array('CALLE SEVILLA', 'GARROTERA');
$vinculo = array('sssssssssssssssss', 'ddddddddddddddddd');
?>


<script type="text/javascript">
var aLocations = new Array();
var aTitles = new Array();
var aSummary = new Array();

aLocations= <?php echo json_encode($dir); ?> ;
aTitles= <?php echo json_encode($nombre); ?> ;
aSummary= <?php echo json_encode($vinculo); ?> ;



$(document).ready(function() {
$('#test').GoogleMap(aLocations, aTitles, aSummary, {
type: 3,
zoom: 5,
tipsuffix: 'enabled'
});
});

</script>