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

    ASP e redirect con funzione JS

    Ciao a tutti,
    ho un link del genere:

    http://www.pippo.com/products.asp?id...Idproducts=119

    dove passo alla pagina dinamica PRODUCTS gli id di due campi del database per visualizzare il prodotto corrispondente.
    Caricando la pagina da sola mi funziona.
    Siccome il sito è strutturato a frame ho una funzione JS che verifica se le pagine richiamate sono contenute nel set di frame, altrimenti lo ricostruisce:
    FUNZIONE JS:
    [CODEfunction reDirect() {
    if (window.top == window.self){


    document.write('<frameset rows="121,*" BORDER="0" SPACING="0" FRAMEBORDER="0" FRAMESPACING="0" MARGINHEIGHT="0" MARGINWIDTH="0" SCROLLING="no" >');
    document.write('<frame src="/homeup.htm" name="top" scrolling="no" noresize target="main" BORDER="0" SPACING="0" FRAMEBORDER="0" FRAMESPACING="0" MARGINHEIGHT=0 MARGINWIDTH=0>');
    document.write('<frameset cols="157,*" BORDER="0" SPACING="0" FRAMEBORDER="0" FRAMESPACING="0" MARGINHEIGHT="0" MARGINWIDTH="0">');
    document.write('<frame src="/menusx.asp" name="menu" scrolling="auto" noresize target="main" BORDER="0" SPACING="0" FRAMEBORDER=0 FRAMESPACING="0" MARGINHEIGHT="0" MARGINWIDTH="0">');
    document.write('<frame src='+document.URL+'? scrolling="auto" name="main" target="_self" BORDER="0" SPACING="0" FRAMEBORDER="0" FRAMESPACING="0" MARGINHEIGHT="0" MARGINWIDTH="0">');
    document.write('</frameset>');
    document.write('</frameset>');
    }
    }
    [/CODE]

    questa funzione mi genera il seguente errore se viene richiamata con il link di cui sopra

    Microsoft VBScript runtime error '800a000d'

    Type mismatch: '[string: "119?"]'

    /products.asp, line 12
    cosa può essere???

    grazie

  2. #2
    scusate ecco la funzione per bene..

    FUNZIONE JS:
    codice:
    function reDirect() { 
    if (window.top == window.self){ 
    
    
    document.write('<frameset rows="121,*" BORDER="0" SPACING="0" FRAMEBORDER="0" FRAMESPACING="0" MARGINHEIGHT="0" MARGINWIDTH="0" SCROLLING="no" >'); 
    document.write('<frame src="/homeup.htm" name="top" scrolling="no" noresize target="main" BORDER="0" SPACING="0" FRAMEBORDER="0" FRAMESPACING="0" MARGINHEIGHT=0 MARGINWIDTH=0>'); 
    document.write('<frameset cols="157,*" BORDER="0" SPACING="0" FRAMEBORDER="0" FRAMESPACING="0" MARGINHEIGHT="0" MARGINWIDTH="0">'); 
    document.write('<frame src="/menusx.asp" name="menu" scrolling="auto" noresize target="main" BORDER="0" SPACING="0" FRAMEBORDER=0 FRAMESPACING="0" MARGINHEIGHT="0" MARGINWIDTH="0">'); 
    document.write('<frame src='+document.URL+'? scrolling="auto" name="main" target="_self" BORDER="0" SPACING="0" FRAMEBORDER="0" FRAMESPACING="0" MARGINHEIGHT="0" MARGINWIDTH="0">'); 
    document.write('</frameset>'); 
    document.write('</frameset>'); 
    } 
    }

  3. #3
    Utente di HTML.it L'avatar di willybit
    Registrato dal
    May 2001
    Messaggi
    4,367
    Ciao gguida,

    cosa c'è alla riga 12 di products.asp?

    comunque... sostituisci la terzultima riga del js con queste due
    codice:
    var questaPagina=document.location.pathname+'?'+document.location.search
    document.write('<frame src="'+questaPagina+'" scrolling="auto" name="main" target="_self" BORDER="0" SPACING="0" FRAMEBORDER="0" FRAMESPACING="0" MARGINHEIGHT="0" MARGINWIDTH="0">');

  4. #4
    grazie della risposta.
    fatto..ma mi dà lo stesso errore...

    nella pagina ASP prima utilizzo gli id passati dal link per selezionare il prodotto:

    codice:
    set prodotto=conn.execute("select * from products where idproducts="& int(request.QueryString("idproducts")))
    set categoria=conn.execute("select * from Cat_products where idcategoria=" & prodotto.fields("idcategoria"))
    set prodcategoria=conn.execute("select * from products where idcategoria=" & prodotto.fields("idcategoria"))

    e dopo costruisco la pagina stampando i vari campi del record selezionato...il primo campo è la righa 12:



    codice:
    <%=Server.HTMLEncode(prodotto.fields("title"))%>

  5. #5
    scusa tutto ok
    grazie...mi ha fregato la cronologia IE

  6. #6
    Utente di HTML.it L'avatar di willybit
    Registrato dal
    May 2001
    Messaggi
    4,367
    hai qualcosa online da vedere? Hai verificato se c'è la querystring?

  7. #7
    Utente di HTML.it L'avatar di willybit
    Registrato dal
    May 2001
    Messaggi
    4,367
    Originariamente inviato da gguida
    scusa tutto ok
    grazie...mi ha fregato la cronologia IE
    stavo per risponderti quando ha squillato il telefono... non è che mi ero addormentato
    tutto è bene quel che finisce bene

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.