I´m trying to make an dynamic page with XML values. When the visitor click
on an item it replaces the content. But it is not doing his job. This is the
code:
$('a').click(function() {
var key = $(this).attr('id').charAt(4);
$('a').click(function() {
var key = $(this).attr('id').charAt(4);
     $.ajax({
         type: "GET",
         url: "../cms/xmlCinema.php?id=000"+key,
         dataType: "xml",
         success: function(xml) {

             $(xml).find("filme").each(function(){
                var texto = " ";
                var album = " ";
                 var texto = '<div class="moviesTitle">' +
$(this).find('nome').text() + ' (<i>' + $(this).find('ano').text() +
'</i>)</div><br>';
                 texto = texto + '<div class="moviesPoster"><img
id="poster'+key+'" name="poster'+key+'"
src="../cinema/poster/000'+key+'.jpg" width="95"></div>';
                 texto = texto + '<div class="moviesLabel">Nome
original:</div> <div class="moviesData">&nbsp;' +
$(this).find('nome_original').text() + '</div>';
                 texto = texto + '<div class="moviesLabel">Estréia:</div>
<div class="moviesData">&nbsp;' + $(this).find('data').text() + '</div>';
                 texto = texto + '<div class="moviesLabel">Trilha:</div>
<div class="moviesData">&nbsp;' + $(this).find('trilha').text() + '</div>';
                 texto = texto + '<div class="moviesLabel">Gênero:</div>
<div class="moviesData">&nbsp;' + $(this).find('genero').text() + '</div>';
                 texto = texto + '<div class="moviesLabel">País de
Origem:</div> <div class="moviesData">&nbsp;' +
$(this).find('pais_de_origem').text() + '</div>';
                 texto = texto + '<div class="moviesLabel">Site:</div> <div
class="moviesData">&nbsp;<a href="' + $(this).find('site').text() + '"
target="_blank">' + $(this).find('site').text() + '</a></div>';
                 texto = texto + '<div class="moviesLabel">Duração:</div>
<div class="moviesData">&nbsp;' + $(this).find('duracao').text() + '
min.</div>';
                 texto = texto + '<div class="moviesLabel">Direção:</div>
<div class="moviesData">&nbsp;' + $(this).find('duracao').text() + '
min.</div>';
                 //Sinopse
                 texto = texto + '<div class="moviesLabel">Sinopse:</div>
<div class="moviesRelease">&nbsp;' + $(this).find('sinopse').text() +
'</div>';
                $('<div></div>')
                     .html(texto)
                     .replaceAll('#fichaFilme ol');
             }); //close each(
         } //close sucess
     }); //close $.ajax(
    $("#fichaFilme").fadeIn(3000);
}); //close click(
If I use "appendTo" it adds content. If I use replaceAll it only works in
the first time.

Here is the page (working on it):
http://www.ncweb.com.br/PHP/index.php?mod=Cinema

Thanks!

-- 
dipi evil danger
"Gott weiß ich will kein Engel sein"
http://meadiciona.com/dipi

Reply via email to