Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Problem sa XML/om u Firefox-u

[es] :: Javascript i AJAX :: Problem sa XML/om u Firefox-u

[ Pregleda: 1235 | Odgovora: 2 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

bjtetf

Član broj: 77307
Poruke: 117
80.65.165.*



+1 Profil

icon Problem sa XML/om u Firefox-u19.03.2010. u 09:17 - pre 171 meseci
Imam code koji radi u IE ali nece u Firefoxu. Radi se o searchu. Sta li moze biti problem?

Code:

<XML ID="proba" SRC="fajl.xml"></XML>

<INPUT TYPE="text" ID="SearchText" />
<button onclick='trazi()'>Trazi</button>
<hr />
Rezultat pretrage: <P>
<DIV id="ResultDiv"></DIV>


<script language="javascript">
function trazi()
{
    SearchString=SearchText.value.toUpperCase();
    if(SearchString=="")
    {
        ResultDiv.innerHTML="Morate unijeti naziv";
        return;
    }
    proba.recordset.moveFirst();
    
    ResultHTML="";
    
    while(!proba.recordset.EOF)
    {
        TitleString = proba.recordset("NAZIV1").value;
    
        if(TitleString.toUpperCase().indexOf(SearchString)>=0)
        {
            ResultHTML += "<B>Naziv1: </B>" + proba.recordset("NAZIV1") + "<BR><B>Naziv2: </B>" + proba.recordset("NAZIV2") + "<BR><B>Naziv3: </B>" + proba.recordset("NAZIV3") + "<BR><B>Naziv4: </B>" + proba.recordset("NAZIV4") + "<BR><B>Naziv5: </B>" + proba.recordset("NAZIV5") + "<P>";
        }
        proba.recordset.moveNext();
    }
    
    
    if(ResultHTML=="")
    {
        ResultDiv.innerHTML="Nema rezultata";
    }
    else
    {
        ResultDiv.innerHTML=ResultHTML;
    }
}
</script>


 
Odgovor na temu

kelja

Član broj: 70429
Poruke: 1416
*.dynamic.isp.telekom.rs.



+35 Profil

icon Re: Problem sa XML/om u Firefox-u19.03.2010. u 23:34 - pre 171 meseci
document.getElementById('SearchText')

document.getElementById('ResultDiv').innerHTML="Morate unijeti naziv"

itd.

Pozdrav!
 
Odgovor na temu

bjtetf

Član broj: 77307
Poruke: 117
80.65.165.*



+1 Profil

icon Re: Problem sa XML/om u Firefox-u22.03.2010. u 10:30 - pre 171 meseci
Malo sam korigovao kod, ali ponovo nece u Firefoxu. Pretpostavljam da segment oko recordseta nisam dobro modifikovao?

Code:

<XML ID="proba" SRC="fajl.xml"></XML>

<INPUT TYPE="text" ID="SearchText" />
<button onclick='trazi()'>Trazi</button>
<hr />
Rezultat pretrage: <P>
<DIV id="ResultDiv"></DIV>


<script language="javascript">
function trazi()
{
    SearchString=document.getElementById('SearchText').value.toUpperCase();

    if(SearchString=="")
    {
       document.getElementById('ResultDiv').innerHTML="Morate unijeti naziv";
        return;
    }
    proba.recordset.moveFirst();
    
    ResultHTML="";
    
    while(!proba.recordset.EOF)
    {
        TitleString = proba.recordset("NAZIV1").value;
    
        if(TitleString.toUpperCase().indexOf(SearchString)>=0)
        {
            ResultHTML += "<B>Naziv1: </B>" + proba.recordset("NAZIV1") + "<BR><B>Naziv2: </B>" + proba.recordset("NAZIV2") + "<BR><B>Naziv3: </B>" + proba.recordset("NAZIV3") + "<BR><B>Naziv4: </B>" + proba.recordset("NAZIV4") + "<BR><B>Naziv5: </B>" + proba.recordset("NAZIV5") + "<P>";
        }
        proba.recordset.moveNext();
    }
    
    
    if(ResultHTML=="")
    {
        document.getElementById('ResultDiv').innerHTML="Nema rezultata";
    }
    else
    {
        document.getElementById('ResultDiv').innerHTML=ResultHTML;
    }
}
</script>


 
Odgovor na temu

[es] :: Javascript i AJAX :: Problem sa XML/om u Firefox-u

[ Pregleda: 1235 | Odgovora: 2 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.