By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,454 Members | 3,191 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,454 IT Pros & Developers. It's quick & easy.

Minor JavaScript compatibility problem with Mozilla

P: 10
Hi,
I am working to display a Flickr rss feed of photos on my website and have users cycle through the photos using a set of javacript/asp arrow buttons. It all seems to work fine on IE but the buttons are not working on Mozilla. It must be a small rule or statement I missed.

The code below is a snippet of what is being used for one of the arrow buttons.


Expand|Select|Wrap|Line Numbers
  1.                     strHTML = strHTML & "<div id='flickr" & DivCount & "' class='flickr-tn" & DivCount & "' style='border:1px; border-style:solid; border-color:#eeeeff;padding:0px;width:" & isSingleRowWidth & "px;height:inherit;'><span style='position:absolute; float:left; top:50%; left:0; vertical-align:middle; line-height:inherit; height:inherit; '><img id=bwd" & DivCount & " src='/images/greyleftarrow2.gif' onclick=""window.flickr" & DivCount & ".style.display='none" & "';window.flickr" & (DivCount-1+DivCount) & ".style.display='" & "';"" style='cursor:pointer;'></span><span style='width=:'" & isSingleRowWidth & "';'>"
  2.  
  3.  
  4.                 else
  5.  
  6.                     strHTML = strHTML & "<div id='flickr" & DivCount & "' class='flickr-tn" & DivCount & "' style='border:1px;  border-style:solid;   border-color:#eeeeff;padding:0px;width:" & isSingleRowWidth & "px;height:inherit;'><span style='position:absolute; float:left; top:50%; left:0; vertical-align:middle; line-height:inherit; height:inherit; '><img id=bwd" & DivCount & " src='/images/greyleftarrow2.gif' onclick=""window.flickr" & DivCount & ".style.display='none" & "';window.flickr" & DivCount-1 & ".style.display='" & "';"" style='cursor:pointer;'></span><span style='width:'" & isSingleRowWidth & "';'>"
any suggestions?
Jan 4 '08 #1
Share this Question
Share on Google+
8 Replies


gits
Expert Mod 5K+
P: 5,333
hi ...

i guess the problem is with setting the divs style.display to an empty value instead of using 'block' ... to make it visible?

kind regards
Jan 5 '08 #2

P: 10
hi ...

i guess the problem is with setting the divs style.display to an empty value instead of using 'block' ... to make it visible?

kind regards
Yes, I forgot to mention that I did try inserting "block" into all the empty values and yet the buttons still do not work on Mozilla. Here is the code as I have it now. The error I receive in the Mozilla Error Console whenever I click on the button to change the photo is "window.flickr1 has no properties.... any help would be appreciated.




Expand|Select|Wrap|Line Numbers
  1. For Each objItem In objItemList
  2.  
  3.         If ThumbCount <= ThumbsPerRow then
  4.  
  5.             If ThumbCount = 1 and DivCount = 1 then
  6.  
  7.                 if Count = 1 then
  8.  
  9.                     strHTML = strHTML & "<div id='flickr" & DivCount & "' class='flickr-tn" & DivCount & "' style='border:1px; border-style:solid; border-color:#eeeeff;padding:0px;width:" & isSingleRowWidth & "px;height:inherit;'><span style='position:absolute; float:left; top:50%; left:0; vertical-align:middle; line-height:inherit; height:inherit; '><img id=bwd" & DivCount & " src='/images/greyleftarrow2.gif' onclick=""window.flickr" & DivCount & ".style.display='none" & "';window.flickr" & (DivCount-1+DivCount) & ".style.display='block" & "';"" style='cursor:pointer;'></span><span style='width:'" & isSingleRowWidth & "px';'>"
  10.  
  11.  
  12.                 else
  13.  
  14.                     strHTML = strHTML & "<div id='flickr" & DivCount & "' class='flickr-tn" & DivCount & "' style='border:1px;  border-style:solid;   border-color:#eeeeff;padding:0px;width:" & isSingleRowWidth & "px;height:inherit;'><span style='position:absolute; float:left; top:50%; left:0; vertical-align:middle; line-height:inherit; height:inherit; '><img id=bwd" & DivCount & " src='/images/greyleftarrow2.gif' onclick=""window.flickr" & DivCount & ".style.display='none" & "';window.flickr" & DivCount-1 & ".style.display='block" & "';"" style='cursor:pointer;'></span><span style='width:'" & isSingleRowWidth & "px';'>"
  15.  
  16.  
  17.                 End if    
  18.  
  19.                 strHTML = strHTML & vbTab & "<span style='font-family:arial,verdana,sans-serif;font-size:11px; '><center>" & safeHTML(objItem.childNodes(0).Text) & "</center></span>" 
  20.             End if
  21.  
  22.             If ThumbCount = 1 and DivCount > 1 then
  23.  
  24.                 strHTML = strHTML & "<div id='flickr" & DivCount & "' class='flickr-tn" & DivCount & "' style='border:1px; border-style:solid;   border-color:#eeeeff;padding:0px;width:" & isSingleRowWidth & "px;display:none;height:inherit;'><span style='width:15px; position:absolute; float:left; top:50%; left:0; vertical-align:middle; line-height:inherit; height:inherit; '><img id=bwd" & DivCount & " src='/images/greyleftarrow2.gif' onclick=""window.flickr" & DivCount & ".style.display='none" & "';window.flickr" & DivCount-1 & ".style.display='block" & "';"" style='cursor:pointer;'></span><span style='width:'" & isSingleRowWidth & "';'>"
  25.                 strHTML = strHTML & vbTab & "<span style='font-family:arial,verdana,sans-serif;font-size:11px;text-align:center'><center>" & safeHTML(objItem.childNodes(0).Text) & "</center></span>"
  26.             End if
  27.  
  28.             if isSingleRow then
  29.  
  30.  
  31.  
  32.  
  33.             else
  34.  
  35.                 If ThumbCount = 3 then
  36.  
  37.  
  38.                     strHTML = strHTML & "<br>"        
  39.  
  40.  
  41.                 End if
  42.  
  43.  
  44.             End if
  45.  
  46.  
  47.                 '################################################################################################################################################################
  48.                 'Writes the photo title. The safeHTML function converts some possibly dodgy characters that might be in your title, into valid XHTML (ampersands, accents etc.)        
  49.                 '################################################################################################################################################################
  50.  
  51.                 'strHTML = strHTML & vbTab & "<span>" & safeHTML(objItem.childNodes(0).Text) & "</span>" & vbCrLf        
  52.  
  53.                 '####################################################################################################
  54.                 'Writes a link pointing to the photo page on Flickr.com, and writes the URL of the newly cached photo        
  55.                 '####################################################################################################
  56.  
  57.                 strHTML = strHTML & vbTab & "<a href=""" & objItem.childNodes(1).Text & """ target=_new onclick=""displayMessage('flickrimage.asp?fn=" & replace(cacheImage(objItem.selectSingleNode("media:thumbnail").getAttribute("url")),"http://www.flickr.com/photos/","") & "&flkr=" & objItem.childNodes(1).Text & "');return false""><img border=0 src=""" & strCacheURL & cacheImage(objItem.selectSingleNode("media:thumbnail").getAttribute("url")) & """ alt=""" & safeHTML(Replace(objItem.childNodes(0).Text & "","""","")) & """ title=""" & safeHTML(Replace(objItem.childNodes(0).Text,"""","")) & """/></a>"
  58.  
  59.             if ThumbCount = 4 then
  60.  
  61.             if Count = 20 then 
  62.  
  63.  
  64.                 strHTML = strHTML & "</span><span style='position:absolute; float:right; top:50%; right:0; vertical-align:middle; line-height:inherit; height:inherit;  width:15px;'><img id=fwd" & DivCount & " src='/images/greyrightarrow2.gif' onclick=""window.flickr" & DivCount & ".style.display='none" & "';window.flickr" & (DivCount+1-DivCount) & ".style.display='block" & "';"" style='cursor:pointer;'></span></div>"
  65.                 DivCount = DivCount + 1
  66.                 ThumbCount = 0
  67.  
  68.             else
  69.  
  70.  
  71.                 strHTML = strHTML & "</span><span style='position:absolute; float:right; top:50%; right:0; vertical-align:middle; line-height:inherit; height:inherit;  width:15px;'><img id=fwd" & DivCount & " src='/images/greyrightarrow2.gif' onclick=""window.flickr" & DivCount & ".style.display='none" & "';window.flickr" & DivCount+1 & ".style.display='block" & "';"" style='cursor:pointer;'></span></div>"
  72.                 DivCount = DivCount + 1
  73.                 ThumbCount = 0
  74.  
  75.             End if
  76.  
  77.             End if
  78.  
  79.         End if
Jan 7 '08 #3

gits
Expert Mod 5K+
P: 5,333
you could try:

Expand|Select|Wrap|Line Numbers
  1. onclick="\"document.getElementById('flickr" & DivCount & ").style.display = 'block';\""
  2.  
instead, to refer to the node with standards compliant dom-methods, note: flickr1 must be the id then

kind regards
Jan 7 '08 #4

P: 10
you could try:

Expand|Select|Wrap|Line Numbers
  1. onclick="\"document.getElementById('flickr" & DivCount & ").style.display = 'block';\""
  2.  
instead, to refer to the node with standards compliant dom-methods, note: flickr1 must be the id then

kind regards
Hi, so I did try by replacing the "window.flickr" statements with document.getElementById but I'm still encountering trouble..



<script type="text/javascript">
messageObj = new DHTML_modalMessage(); // We only create one object of this class
messageObj.setShadowOffset(5); // Large shadow


function displayMessage(url)
{

messageObj.setSource(url);
messageObj.setCssClassMessageBox(false);
messageObj.setSize(400,400);
messageObj.setShadowDivVisible(true); // Enable shadow for these boxes
messageObj.display();
}

function displayStaticMessage(messageContent,cssClass)
{
messageObj.setHtmlContent(messageContent);
messageObj.setSize(400,400);
messageObj.setCssClassMessageBox(cssClass);
messageObj.setSource(false); // no html source since we want to use a static message here.
messageObj.setShadowDivVisible(false); // Disable shadow for these boxes
messageObj.display();


}

function closeMessage()
{
messageObj.close();
}


</script>

<%

isFirecrest = NULL
strIPAddress = request.servervariables("REMOTE_ADDR")
Call fn_CheckNetwork(strIPAddress,isFirecrest)


'################################################# #############################################
'URL of your RSS feed (copy from the "Feed" link of your Flickr gallery
'################################################# #############################################

Dim strXMLURL
strXMLURL = "http://api.flickr.com/services/feeds/photos_public.gne?id=16512192@N08&lang=en-us&format=rss_200"

'#################################################
'The name of the file to which the HTML is cached
'#################################################

Dim strCacheHTML
strCacheHTML = "flickr.asp"

'################################################# ###########
'The local path to the folder you will cache photos to, e.g.
'################################################# ###########


Dim strCachePath
strCachePath = "\\www1\serverone\www\nanet.britainusa.com\images\ flickrfeed\"


'#################################################
'The public URL to the above cache directory, e.g.
'#################################################


Dim strCacheURL

if isFirecrest then
strCacheURL = "https://nanet.britainusa.com/images/flickrfeed/"
else
strCacheURL = "http://nanet.britainusa.com/images/flickrfeed/"
End if


'################################################# #############################################
'This function takes the URL of the RSS feed, and the XML node name of each photo
'################################################# #############################################


Function getXMLNode(strURL, strNode)

Dim objXML
Set objXML = Server.CreateObject("MSXML2.FreeThreadedDOMDocumen t")
objXML.Async = False
objXML.setProperty "ServerHTTPRequest", True
objXML.Load(strURL)

'################################################# ###
'Returns a collection of nodes to be looped through
'################################################# ###


Set getXMLNode = objXML.getElementsByTagName(strNode)
Set objXML = Nothing

End Function



Function cacheFileIsExpired(strFileName, cacheInterval, cacheIntervalUnit)

If cacheInterval = 0 Then
cacheFileIsExpired = True
Exit Function
End If


On Error Resume Next


Dim cacheFSO
Set cacheFSO = CreateObject("Scripting.FileSystemObject")

Dim cacheFile
Set cacheFile = cacheFSO.GetFile(strCachePath & strFileName)

Dim strDate
strDate = cacheFile.DateLastModified
Set objFile = Nothing

Select Case cacheIntervalUnit

Case "minutes"
strUnit = "n"

Case "hours"
strUnit = "h"

Case "days"
strUnit = "d"
End Select

cacheFileIsExpired = (DateDiff(strUnit,CDate(strDate), Now()) > cacheInterval)

If err.Number <> 0 Then
cacheFileIsExpired = True
End If

Set cacheFile = Nothing
Set cacheFSO = Nothing

End Function








Function writeCachedFile(strFileName, strText)

Dim cacheFSO
Set cacheFSO = CreateObject("Scripting.FileSystemObject")

Dim cacheFile
Set cacheFile = cacheFSO.CreateTextFile(strCachePath & strFileName, True, True)
cacheFile.Write(strText)
cacheFile.Close

Set cacheFile = Nothing
Set cacheFSO = Nothing
writeCachedFile = strText

End Function







Function getCachedFile(strFileName)

Dim cacheFSO
Set cacheFSO = CreateObject("Scripting.FileSystemObject")

Dim cacheFile
Set cacheFile = cacheFSO.OpenTextFile(strCachePath & strFileName,1,False,-1)

getCachedFile = cacheFile.ReadAll

Set cacheFile = Nothing
Set cacheFSO = Nothing

End Function



function SafeHTML(ByVal pStrHTML)

'Dim lObjRegExp
'if VarType(pStrHTML) = vbNull Then Exit function
'if pStrHTML = "" Then Exit function
'Set lObjRegExp = New RegExp
'lObjRegExp.Global = True
'lObjRegExp.IgnoreCase = True
'lObjRegExp.Pattern = "<(/)?SCRIPT|META|STYLE([^>]*)>"
'pStrHTML = lObjRegExp.Replace(pStrHTML, "<$1SCRIPT$3>")
'lObjRegExp.Pattern = "<(/)?(LINK|IFRAME|FRAMESET|FRAME|APPLET|OBJECT)([^>]*)>"
'pStrHTML = lObjRegExp.Replace(pStrHTML, "<$1LINK$3>")
'lObjRegExp.Pattern = "(<A[^>]+href\s?=\s?""?javascript:)[^""]*(""[^>]+>)"
'pStrHTML = lObjRegExp.Replace(pStrHTML, "$1//protected$2")
'lObjRegExp.Pattern = "(<IMG[^>]+src\s?=\s?""?javascript:)[^""]*(""[^>]+>)"
'pStrHTML = lObjRegExp.Replace(pStrHTML, "$1//protected$2")
'lObjRegExp.Pattern = "<([^>]*) on[^=\s]+\s?=\s?([^>]*)>"
'pStrHTML = lObjRegExp.Replace(pStrHTML, "<$1$3>")
'Set lObjRegExp = Nothing

SafeHTML = pStrHTML

End function







'################################################# #############################################
'This function pulls the thumbnail images frm Flickr and saves them to the local web server
'################################################# #############################################


Function cacheImage(imageURL)

Dim cacheFSO
Set cacheFSO = CreateObject("Scripting.FileSystemObject")

Dim aFileName
aFileName = Split(imageURL,"/")
MediumImageURL = replace(imageURL, "_s.","_m.")
LargeImageURL = replace(imageURL, "_s.","_l.")

Dim strFileName
strFileName = aFileName(UBound(aFileName))
strMediumFileName = replace(strFileName,"_s.","_m.")
strLargeFileName = replace(strFileName,"_s.","_l.")

'################################################# #
'Check to see if the photo has been cached already
'################################################# #


If Not cacheFSO.FileExists(strCachePath & strFileName) Then

Dim objXMLHTTP
Set objXMLHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")

Dim objJpeg
Set objJpeg = Server.CreateObject("Persits.Jpeg")


objXMLHTTP.Open "GET", imageURL
objXMLHTTP.Send

'###############################################
'Reads the image from Flickr.com
'###############################################



objJpeg.OpenBinary(objXMLHTTP.ResponseBody)



'###############################################
'And saves it to the local web server
'###############################################

objJpeg.Save strCachePath & strFileName

objXMLHTTP.Open "GET", MediumImageURL
objXMLHTTP.Send

'###############################################
'Reads the image from Flickr.com
'###############################################



objJpeg.OpenBinary(objXMLHTTP.ResponseBody)



'###############################################
'And saves it to the local web server
'###############################################

objJpeg.Save strCachePath & strMediumFileName




'objXMLHTTP.Open "GET", LargeImageURL
'objXMLHTTP.Send

'###############################################
'Reads the image from Flickr.com
'###############################################



'objJpeg.OpenBinary(objXMLHTTP.ResponseBody)



'###############################################
'And saves it to the local web server
'###############################################

'objJpeg.Save strCachePath & strLargeFileName



Set objXMLHTTP = Nothing
Set objJpeg = Nothing

End If

Set cacheFSO = Nothing
Set aFileName = Nothing

'Returns the filename, e.g. "myphoto.jpg"

cacheImage = strFileName

Set strFileName = Nothing

End Function

'################################################# #
'Checks to see whether the cached HTML has expired
'################################################# #


If cacheFileIsExpired(strCacheHTML, 1, "n") Then

'################################################# ################################################## ################################################## #
'Creates a collection of XML nodes. The getXMLNode function is passed the URL of the Flickr RSS feed, and the node name for each photo record ("item")
'################################################# ################################################## ################################################## #

Dim objItemList
Set objItemList = getXMLNode(strXMLURL, "item")

Dim objItem, strHTML, ThumbCount, DivCount
ThumbCount = 1
DivCount = 1
ThumbsPerRow = 4
Count = 1

isSingleRow = false

if isSingleRow then
isSingleRowWidth = 360
else
isSingleRowWidth = 200
End if

'###############################################
'Loops through each photo
'###############################################

%>




<%


For Each objItem In objItemList

If ThumbCount <= ThumbsPerRow then

If ThumbCount = 1 and DivCount = 1 then

if Count = 1 then

strHTML = strHTML & "<div id='flickr" & DivCount & "' class='flickr-tn" & DivCount & "' style='border:1px; border-style:solid; border-color:#eeeeff;padding:0px;width:" & isSingleRowWidth & "px;height:inherit;'><span style='position:absolute; float:left; top:50%; left:0; vertical-align:middle; line-height:inherit; height:inherit; '><img id=bwd" & DivCount & " src='/images/greyleftarrow2.gif' onclick="\"document.getElementById('flickr1" & DivCount & ").style.display='none" & "';document.getElementById('flickr1" & (DivCount-1+DivCount) & ".style.display='block'\"";"" style='cursor:pointer;'></span><span style='width:'" & isSingleRowWidth & "px';'>"


else

strHTML = strHTML & "<div id='flickr" & DivCount & "' class='flickr-tn" & DivCount & "' style='border:1px; border-style:solid; border-color:#eeeeff;padding:0px;width:" & isSingleRowWidth & "px;height:inherit;'><span style='position:absolute; float:left; top:50%; left:0; vertical-align:middle; line-height:inherit; height:inherit; '><img id=bwd" & DivCount & " src='/images/greyleftarrow2.gif' onclick="\"document.getElementById('flickr1" & DivCount & ").style.display='none" & "';document.getElementById('flickr1" & (DivCount-1) & ".style.display='block'\"" style='cursor:pointer;'></span><span style='width:'" & isSingleRowWidth & "px';'>"


End if

strHTML = strHTML & vbTab & "<span style='font-family:arial,verdana,sans-serif;font-size:11px; '><center>" & safeHTML(objItem.childNodes(0).Text) & "</center></span>"
End if

If ThumbCount = 1 and DivCount > 1 then

strHTML = strHTML & "<div id='flickr" & DivCount & "' class='flickr-tn" & DivCount & "' style='border:1px; border-style:solid; border-color:#eeeeff;padding:0px;width:" & isSingleRowWidth & "px;display:none;height:inherit;'><span style='width:15px; position:absolute; float:left; top:50%; left:0; vertical-align:middle; line-height:inherit; height:inherit; '><img id=bwd" & DivCount & " src='/images/greyleftarrow2.gif' onclick="\"document.getElementById('flickr" & DivCount & ").style.display='none" & "';document.getElementById('flickr1" & (DivCount-1) & ".style.display='block'\"";"" style='cursor:pointer;'></span><span style='width:'" & isSingleRowWidth & "';'>"
strHTML = strHTML & vbTab & "<span style='font-family:arial,verdana,sans-serif;font-size:11px;text-align:center'><center>" & safeHTML(objItem.childNodes(0).Text) & "</center></span>"
End if

if isSingleRow then




else

If ThumbCount = 3 then


strHTML = strHTML & "<br>"


End if


End if


'################################################# ################################################## ################################################## ###########
'Writes the photo title. The safeHTML function converts some possibly dodgy characters that might be in your title, into valid XHTML (ampersands, accents etc.)
'################################################# ################################################## ################################################## ###########

'strHTML = strHTML & vbTab & "<span>" & safeHTML(objItem.childNodes(0).Text) & "</span>" & vbCrLf

'################################################# ################################################## #
'Writes a link pointing to the photo page on Flickr.com, and writes the URL of the newly cached photo
'################################################# ################################################## #

strHTML = strHTML & vbTab & "<a href=""" & objItem.childNodes(1).Text & """ target=_new onclick=""displayMessage('flickrimage.asp?fn=" & replace(cacheImage(objItem.selectSingleNode("media :thumbnail").getAttribute("url")),"http://www.flickr.com/photos/","") & "&flkr=" & objItem.childNodes(1).Text & "');return false""><img border=0 src=""" & strCacheURL & cacheImage(objItem.selectSingleNode("media:thumbna il").getAttribute("url")) & """ alt=""" & safeHTML(Replace(objItem.childNodes(0).Text & "","""","")) & """ title=""" & safeHTML(Replace(objItem.childNodes(0).Text,""""," ")) & """/></a>"

if ThumbCount = 4 then

if Count = 20 then


strHTML = strHTML & "</span><span style='position:absolute; float:right; top:50%; right:0; vertical-align:middle; line-height:inherit; height:inherit; width:15px;'><img id=fwd" & DivCount & " src='/images/greyrightarrow2.gif' onclick="\"document.getElementById('flickr1" & DivCount & ").style.display='none" & "';document.getElementById('flickr" & (DivCount+1-DivCount) & ".style.display='block'\"" & ;"" style='cursor:pointer;'></span></div>"
DivCount = DivCount + 1
ThumbCount = 0

else


strHTML = strHTML & "</span><span style='position:absolute; float:right; top:50%; right:0; vertical-align:middle; line-height:inherit; height:inherit; width:15px;'><img id=fwd" & DivCount & " src='/images/greyrightarrow2.gif' onclick="\"document.getElementById('flickr1" & DivCount & ").style.display='none" & "';document.getElementById('flickr1" & (DivCount+1) & ".style.display='block'\"" & ;"" style='cursor:pointer;'></span></div>"
DivCount = DivCount + 1
ThumbCount = 0

End if

End if

End if







'response.write "thumbcount: " & thumbcount & "<br>"
'response.write "divcount: " & divcount & "<br>"

if Count = 20 then
exit for
End if

Count = Count + 1
ThumbCount = ThumbCount + 1
Next

if ThumbCount < 4 and ThumbCount > 0 then

strHTML = strHTML & "</span><span position:absolute; float:right; top:50%; right:0; vertical-align:middle; line-height:inherit; height:inherit; border:1px; border-style:solid; ><img id=fwd" & DivCount & " src='/images/greyrightarrow2.gif' onclick='flickr(" & DivCount & ",2);' style='cursor:pointer;'></span></div>"

End if



Set objItemList = Nothing
Set objItem = Nothing



'################################################# #############################################
'Update the HTML cache, and write output to the page
'################################################# #############################################

Response.Write(writeCachedFile(strCacheHTML, strHTML))

Set strHTML = Nothing

Else

'################################################# #############################################
'If cache is not out of date, server up the cached HTML file
'################################################# #############################################

Response.Write(getCachedFile(strCacheHTML))

End If

Set strURL = Nothing
Set strCacheHTML = Nothing



%>
Jan 7 '08 #5

gits
Expert Mod 5K+
P: 5,333
aaarg, sorry my bad ... we missed a single-quote before the bracket:

Expand|Select|Wrap|Line Numbers
  1. onclick="\"document.getElementById('flickr" & DivCount & "').style.display = 'block';\""
  2.  
in case it is not working ... what error do you get?

kind regards
Jan 8 '08 #6

P: 10
aaarg, sorry my bad ... we missed a single-quote before the bracket:

Expand|Select|Wrap|Line Numbers
  1. onclick="\"document.getElementById('flickr" & DivCount & "').style.display = 'block';\""
  2.  
in case it is not working ... what error do you get?

kind regards

Hello again, I tried with the additional single-quote but I still receive an error and the rest of the page will not load. Here is the error:



Microsoft VBScript runtime error '800a000d'

Type mismatch: '[string: " src='/images/greyle"]'

/flickrcache2.asp, line 392





these are the changes I made to the code:

Expand|Select|Wrap|Line Numbers
  1. <%
  2.  
  3.  
  4. For Each objItem In objItemList
  5.  
  6. If ThumbCount <= ThumbsPerRow then
  7.  
  8. If ThumbCount = 1 and DivCount = 1 then
  9.  
  10. if Count = 1 then
  11.  
  12. strHTML = strHTML & "<div id='flickr" & DivCount & "' class='flickr-tn" & DivCount & "' style='border:1px; border-style:solid; border-color:#eeeeff;padding:0px;width:" & isSingleRowWidth & "px;height:inherit;'><span style='position:absolute; float:left; top:50%; left:0; vertical-align:middle; line-height:inherit; height:inherit; '><img id=bwd" & DivCount & " src='/images/greyleftarrow2.gif' onclick="\"document.getElementById('flickr" & DivCount & "').style.display='none" & "';document.getElementById('flickr" & (DivCount-1+DivCount) & "').style.display='block';\"" style='cursor:pointer;'></span><span style='width:'" & isSingleRowWidth & "px';'>"
  13.  
  14.  
  15. else
  16.  
  17. strHTML = strHTML & "<div id='flickr" & DivCount & "' class='flickr-tn" & DivCount & "' style='border:1px; border-style:solid; border-color:#eeeeff;padding:0px;width:" & isSingleRowWidth & "px;height:inherit;'><span style='position:absolute; float:left; top:50%; left:0; vertical-align:middle; line-height:inherit; height:inherit; '><img id=bwd" & DivCount & " src='/images/greyleftarrow2.gif' onclick="\"document.getElementById('flickr" & DivCount & "').style.display='none" & "';document.getElementById('flickr1" & (DivCount-1) & "').style.display='block';\"" style='cursor:pointer;'></span><span style='width:'" & isSingleRowWidth & "px';'>"
  18.  
  19.  
  20. End if
  21.  
  22. strHTML = strHTML & vbTab & "<span style='font-family:arial,verdana,sans-serif;font-size:11px; '><center>" & safeHTML(objItem.childNodes(0).Text) & "</center></span>"
  23. End if
  24.  
  25. If ThumbCount = 1 and DivCount > 1 then
  26.  
  27. strHTML = strHTML & "<div id='flickr" & DivCount & "' class='flickr-tn" & DivCount & "' style='border:1px; border-style:solid; border-color:#eeeeff;padding:0px;width:" & isSingleRowWidth & "px;display:none;height:inherit;'><span style='width:15px; position:absolute; float:left; top:50%; left:0; vertical-align:middle; line-height:inherit; height:inherit; '><img id=bwd" & DivCount & " src='/images/greyleftarrow2.gif' onclick="\"document.getElementById('flickr" & DivCount & "').style.display='none" & "';document.getElementById('flickr1" & (DivCount-1) & "').style.display='block';\"" style='cursor:pointer;'></span><span style='width:'" & isSingleRowWidth & "';'>"
  28. strHTML = strHTML & vbTab & "<span style='font-family:arial,verdana,sans-serif;font-size:11px;text-align:center'><center>" & safeHTML(objItem.childNodes(0).Text) & "</center></span>"
  29. End if
  30.  
  31. if isSingleRow then
  32.  
  33.  
  34.  
  35.  
  36. else
  37.  
  38. If ThumbCount = 3 then
  39.  
  40.  
  41. strHTML = strHTML & "<br>"
  42.  
  43.  
  44. End if
  45.  
  46.  
  47. End if
  48.  
  49.  
  50. '################################################# ################################################## ################################################## ###########
  51. 'Writes the photo title. The safeHTML function converts some possibly dodgy characters that might be in your title, into valid XHTML (ampersands, accents etc.)
  52. '################################################# ################################################## ################################################## ###########
  53.  
  54. 'strHTML = strHTML & vbTab & "<span>" & safeHTML(objItem.childNodes(0).Text) & "</span>" & vbCrLf
  55.  
  56. '################################################# ################################################## #
  57. 'Writes a link pointing to the photo page on Flickr.com, and writes the URL of the newly cached photo
  58. '################################################# ################################################## #
  59.  
  60. strHTML = strHTML & vbTab & "<a href=""" & objItem.childNodes(1).Text & """ target=_new onclick=""displayMessage('flickrimage.asp?fn=" & replace(cacheImage(objItem.selectSingleNode("media:thumbnail").getAttribute("url")),"http://www.flickr.com/photos/","") & "&flkr=" & objItem.childNodes(1).Text & "');return false""><img border=0 src=""" & strCacheURL & cacheImage(objItem.selectSingleNode("media:thumbnail").getAttribute("url")) & """ alt=""" & safeHTML(Replace(objItem.childNodes(0).Text & "","""","")) & """ title=""" & safeHTML(Replace(objItem.childNodes(0).Text,"""","")) & """/></a>"
  61.  
  62. if ThumbCount = 4 then
  63.  
  64. if Count = 20 then
  65.  
  66.  
  67. strHTML = strHTML & "</span><span style='position:absolute; float:right; top:50%; right:0; vertical-align:middle; line-height:inherit; height:inherit; width:15px;'><img id=fwd" & DivCount & " src='/images/greyrightarrow2.gif' onclick="\"document.getElementById('flickr1" & DivCount & "').style.display='none" & "';document.getElementById('flickr" & (DivCount+1-DivCount) & "').style.display='block'\"" & ;"" style='cursor:pointer;'></span></div>"
  68. DivCount = DivCount + 1
  69. ThumbCount = 0
  70.  
  71. else
  72.  
  73.  
  74. strHTML = strHTML & "</span><span style='position:absolute; float:right; top:50%; right:0; vertical-align:middle; line-height:inherit; height:inherit; width:15px;'><img id=fwd" & DivCount & " src='/images/greyrightarrow2.gif' onclick="\"document.getElementById('flickr1" & DivCount & "').style.display='none" & "';document.getElementById('flickr1" & (DivCount+1) & "').style.display='block'\"" & ;"" style='cursor:pointer;'></span></div>"
  75. DivCount = DivCount + 1
  76. ThumbCount = 0
  77.  
  78. End if
  79.  
  80. End if
  81.  
  82. End if
Jan 8 '08 #7

gits
Expert Mod 5K+
P: 5,333
hi ...

hmmmmm ... there might be a problem after the 'block' word ... you have:

.... block;\"" style ...

i think this ends the string ... and may be you should remove one double quote there ... but basically you sould ensure the correct usage of singe, double and escaped quotes ...

and posting one example would be enough ... :) you don't need to always post the entire code ...

kind regards
Jan 8 '08 #8

P: 10
Thank you for your help, and apologies for cluttering the forum with all that code! I'll give it a try.
Jan 8 '08 #9

Post your reply

Sign in to post your reply or Sign up for a free account.