Visualizzazione dei risultati da 1 a 8 su 8

Discussione: apici news scorrevoli

  1. #1
    Utente di HTML.it L'avatar di jet
    Registrato dal
    Dec 2002
    residenza
    Chieti
    Messaggi
    866

    apici news scorrevoli

    Salve, se uso l'apice ’ il codice è ok, mentre se utilizzo il classico da tastiera ' da errore;
    con il replace inserito non da errore, ma non visualizza nulla.


    • <a target="_top" HREF="dettaglio_eventi.asp?<%= MM_keepNone & MM_joinChar(MM_keepNone) & "ID=" & rsNotizia.Fields.Item("ID").Value %>"> <%Titolo=rsNotizia("Titolo")%><%Titolo = Ucase(Titolo)%><%Titolo = Replace(Titolo,"'","’")%>
    <a target="_top" HREF="dettaglio_eventi.asp?<%= MM_keepNone & MM_joinChar(MM_keepNone) & "ID=" & rsNotizia.Fields.Item("ID").Value %>"> <%Titolo=rsNotizia("Titolo")%><%Titolo = Ucase(Titolo)%> <%Titolo = Replace(Titolo,"'","’")%>
    <%=Titolo%></a>[/list]

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Se sei dentro JS devi mettere l'escape \'

    Roby

  3. #3
    Utente di HTML.it L'avatar di jet
    Registrato dal
    Dec 2002
    residenza
    Chieti
    Messaggi
    866
    Così non va lo stesso. Dove sbaglio?

    <%Titolo = Replace(Titolo,"\'","’")%>

  4. #4
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Ma sei dentro js?

    Roby

  5. #5
    Utente di HTML.it L'avatar di jet
    Registrato dal
    Dec 2002
    residenza
    Chieti
    Messaggi
    866
    si, ma ottengo l'errore 800a005e Invalid use of Null: 'Replace'

  6. #6
    Utente di HTML.it L'avatar di jet
    Registrato dal
    Dec 2002
    residenza
    Chieti
    Messaggi
    866
    avevo già fatto un replace primanel codice, l'ho eliminato e adesso non ottego errori, nel senso che nell'html si stampa tutto, ma non visualizzo nulla!

  7. #7
    Utente di HTML.it L'avatar di jet
    Registrato dal
    Dec 2002
    residenza
    Chieti
    Messaggi
    866
    ecco tutta la pagina:

    • <?xml version="1.0" encoding="iso-8859-1"?>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <%@LANGUAGE="VBSCRIPT"%>

      <%
      Dim rsNotizia
      Dim rsNotizia_numRows

      Set rsNotizia = Server.CreateObject("ADODB.Recordset")
      rsNotizia.ActiveConnection = MM_connNews_STRING
      rsNotizia.Source = "SELECT * FROM News ORDER BY ID DESC"
      rsNotizia.CursorType = 0
      rsNotizia.CursorLocation = 2
      rsNotizia.LockType = 1
      rsNotizia.Open()
      rsNotizia_numRows = 0
      %>
      <%
      Dim Repeat1__numRows
      Dim Repeat1__index

      Repeat1__numRows = 20
      Repeat1__index = 0
      rsNotizia_numRows = rsNotizia_numRows + Repeat1__numRows
      %>

      <%
      Dim MM_paramName
      %>
      <%
      ' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

      Dim MM_keepNone
      Dim MM_keepURL
      Dim MM_keepForm
      Dim MM_keepBoth

      Dim MM_removeList
      Dim MM_item
      Dim MM_nextItem

      ' create the list of parameters which should not be maintained
      MM_removeList = "&index="
      If (MM_paramName <> "") Then
      MM_removeList = MM_removeList & "&" & MM_paramName & "="
      End If

      MM_keepURL=""
      MM_keepForm=""
      MM_keepBoth=""
      MM_keepNone=""

      ' add the URL parameters to the MM_keepURL string
      For Each MM_item In Request.QueryString
      MM_nextItem = "&" & MM_item & "="
      If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
      MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
      End If
      Next

      ' add the Form variables to the MM_keepForm string
      For Each MM_item In Request.Form
      MM_nextItem = "&" & MM_item & "="
      If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
      MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
      End If
      Next

      ' create the Form + URL string and remove the intial '&' from each of the strings
      MM_keepBoth = MM_keepURL & MM_keepForm
      If (MM_keepBoth <> "") Then
      MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
      End If
      If (MM_keepURL <> "") Then
      MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
      End If
      If (MM_keepForm <> "") Then
      MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
      End If

      ' a utility function used for adding additional parameters to these strings
      Function MM_joinChar(firstItem)
      If (firstItem <> "") Then
      MM_joinChar = "&"
      Else
      MM_joinChar = ""
      End If
      End Function
      %>

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      <html>

      <head>
      <title>.:: maryroypub - eventi scorrevoli ::.</title>

      <link rel="stylesheet" href="irish.css" type="text/css">

      <body>

      <table align="center" border="0" cellpadding="0" cellspacing="0" width="350">
      <tr>
      <td align="center" height="20" class="eventi_sc">

      <script language="JavaScript1.2">
      //Specify the marquee's width (in pixels)
      var marqueewidth="350px"
      //Specify the marquee's height
      var marqueeheight="25px"
      //Specify the marquee's marquee speed (larger is faster 1-10)
      var marqueespeed=1
      //configure background color:
      var marqueebgcolor=""
      //Pause marquee onMousever (0=no. 1=yes)?
      var pauseit=1

      //Specify the marquee's content (don't delete <nobr> tag)
      //Keep all content on ONE line, and backslash any single quotations (ie: that\'s great):
      var marqueecontent='<nobr><%
      While ((Repeat1__numRows <> 0) AND (NOT rsNotizia.EOF))
      %><a target="_top" HREF="dettaglio_eventi.asp?<%= MM_keepNone & MM_joinChar(MM_keepNone) & "ID=" & rsNotizia.Fields.Item("ID").Value %>"> <%Titolo=rsNotizia("Titolo")%><%Titolo = Ucase(Titolo)%><%Titolo = Replace(Titolo,"\'","’")%>
      <%=Titolo%></a><span class="txtbordeaux">*</span><%
      Repeat1__index=Repeat1__index+1
      Repeat1__numRows=Repeat1__numRows-1
      rsNotizia.MoveNext()
      Wend
      %></nobr>'


      ////NO NEED TO EDIT BELOW THIS LINE////////////
      marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1) //slow speed down by 1 for NS
      var copyspeed=marqueespeed
      var pausespeed=(pauseit==0)? copyspeed: 0
      var iedom=document.all||document.getElementById
      if (iedom)
      document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+marqueecontent+'</span>')
      var actualwidth=''
      var cross_marquee, ns_marquee

      function populate(){
      if (iedom){
      cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
      cross_marquee.style.left=parseInt(marqueewidth)+8+ "px"
      cross_marquee.innerHTML=marqueecontent
      actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
      }
      else if (document.layers){
      ns_marquee=document.ns_marquee.document.ns_marquee 2
      ns_marquee.left=parseInt(marqueewidth)+8
      ns_marquee.document.write(marqueecontent)
      ns_marquee.document.close()
      actualwidth=ns_marquee.document.width
      }
      lefttime=setInterval("scrollmarquee()",20)
      }
      window.onload=populate

      function scrollmarquee(){
      if (iedom){
      if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
      cross_marquee.style.left=parseInt(cross_marquee.st yle.left)-copyspeed+"px"
      else
      cross_marquee.style.left=parseInt(marqueewidth)+8+ "px"

      }
      else if (document.layers){
      if (ns_marquee.left>(actualwidth*(-1)+8))
      ns_marquee.left-=copyspeed
      else
      ns_marquee.left=parseInt(marqueewidth)+8
      }
      }

      if (iedom||document.layers){
      with (document){
      document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
      if (iedom){
      write('<div style="position:relative;width:'+marqueewidth+';he ight:'+marqueeheight+';overflow:hidden">')
      write('<div style="position:absolute;width:'+marqueewidth+';he ight:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
      write('<div id="iemarquee" style="position:absolute;left:0px;top:0px"></div>')
      write('</div></div>')
      }
      else if (document.layers){
      write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
      write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
      write('</ilayer>')
      }
      document.write('</td></table>')
      }
      }
      </script>

      </td>
      </tr>
      </table>
      </body>
      </html>
      <%
      rsNotizia.Close()
      Set rsNotizia = Nothing
      %>

  8. #8
    Utente di HTML.it L'avatar di jet
    Registrato dal
    Dec 2002
    residenza
    Chieti
    Messaggi
    866
    Ho risolto!
    Ho fatto il replace nella pagina di aggiornamento
    titolo= Replace(titolo, "'", "\’")


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 © 2026 vBulletin Solutions, Inc. All rights reserved.