Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    Aiuto URGENTE caricare file xml esterno



    chiedo scusa lo script che sto usando carica un file images.xml che è nello stesso percorso della pagina html e del filmato.

    se sposto in una cartella filmato e file non funziona più

    siccome vorrei realizzare 3 transazioni con 3 file xml diversi, non riesco a capire dalla sintassi
    dove viene specificato il file xml da leggere, spero di ricevere un aiuto perchè non so come andare avanti.

    grazie

    Alessio:

    porzione di codice che dice di caricare il file XML:

    // *** load the external xml ** //
    ImageFader.prototype.loadXML = function (x) {
    var _xml = new XML ();
    _xml.ignoreWhite = true;
    _xml.path = this;
    _xml.load (x);
    _xml.onLoad = function () {
    for (var a = 0; a < this.firstChild.childNodes.length; a++) {
    var _trans = this.firstChild.childNodes[a].attributes.TRANSITION;
    var _pause = this.firstChild.attributes.PAUSE
    var _txt = this.firstChild.childNodes[a].attributes.TITLE
    var _lnk = this.firstChild.childNodes[a].attributes.LINK
    var _img = this.firstChild.childNodes[a].firstChild.nodeValue;
    this.path._dataProvider.push ({img:_img, title:_txt, link:_lnk, transition:_trans, pause:_pause});
    }
    this.path.startFading ();
    delete this;
    };
    };// *** load the external xml ** //
    ImageFader.prototype.loadXML = function (x) {
    var _xml = new XML ();
    _xml.ignoreWhite = true;
    _xml.path = this;
    _xml.load (x);
    _xml.onLoad = function () {
    for (var a = 0; a < this.firstChild.childNodes.length; a++) {
    var _trans = this.firstChild.childNodes[a].attributes.TRANSITION;
    var _pause = this.firstChild.attributes.PAUSE
    var _txt = this.firstChild.childNodes[a].attributes.TITLE
    var _lnk = this.firstChild.childNodes[a].attributes.LINK
    var _img = this.firstChild.childNodes[a].firstChild.nodeValue;
    this.path._dataProvider.push ({img:_img, title:_txt, link:_lnk, transition:_trans, pause:_pause});
    }
    this.path.startFading ();
    delete this;
    };
    };
    >> . <<

  2. #2
    a parte il fatto che il codice è "duplicato"... due volte...

    l'istruzione che carica il file xml è questa:
    codice:
     _xml.load (x);
    Quella x è una variabile dove è memorizzato il nome del file XML.

    Quindi trova dove viene utilizzata la variabile ed il gioco è fatto.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.