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

ASP \ JAVASCRIPT \ FIrefox and Safari issues - please help!!

P: 2
Can anyone help me please (i am quite a novice, but having fun learning). Im not sure if this is an ASP problem, a javascript problem or a browser problem.

Firstly, everything i have written works fine in IE7 and beta IE8. My pages do not work however in Safari or Firefox, and please dont beat me, but i use Frontpage to write my site, and i use iframes as ive not discovered how to do this any differently!

So the issue is this, i have a large database of music, on selecting an item from the menu, frame 1 gets populated with song titles, on clicking one of the song titles, another frame is fpopulated wtih content, images and text, and a 3rd frame is populated with release and chart information and a 4th frame is populated with reviews of that record.

You can see it in action here : http://www.eurythmics.me.uk/discogra...ographynew.htm


The code i have in the ASP page for selecting the track is as follows, and i think it is this line that causes the problem:

Response.Write("<a target=""_self"" href=""javascript:setframes('title.asp?Title=" & Server.HTMLEncode(objRS("TITLE")) & "&format=" & Server.HTMLEncode(objRS("ALBUMSINGLE")) & "','chartdetails.asp?Title=" & Server.HTMLEncode(objRS("TITLE")) & "&format=" & Server.HTMLEncode(objRS("ALBUMSINGLE")) & "','../../../reviews/reviews.asp?Title=" & Server.HTMLEncode(objRS("TITLE")) & "');"">" & trim(UCASE(objrs("Title"))) & "</a><br>")


Here's the whole page.
Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. <%
  4. Dim objConn
  5. Set objConn = Server.CreateObject("ADODB.Connection")
  6. objConn.Open Application("EurythmicsDatabase_ConnectionString")
  7. Dim objRS, Sql, SortOrder, AZColour, ReleaseColour
  8. SortOrder="TITLE"
  9. AZColour="#FF0000"
  10. ReleaseColour="#FFFFFF"
  11. If Request.QueryString("SortBy")<>"" Then
  12. SortOrder=Request.QueryString("SortBy")
  13. AZColour="#FFFFFF"
  14. ReleaseColour="#FF0000"
  15. End If
  16.  
  17. '********************************************************************
  18. 'New Code for single page query. Need to pass Artist and Format in Query String
  19. 'Example Query String from link would be test.asp?ARTIST=eurythmics&albumsingle=Single
  20. 'Also need to make sure we pass those details when sorting the page so JavaScript needed to be amended
  21. '*********************************************************************
  22. Dim SortFormat, SortArt
  23. SortArt=trim(Request.QueryString("Artist"))
  24. SortFormat=trim(Request.QueryString("AlbumSingle"))
  25. Sql="SELECT MainListTbl.TITLE, MainListTbl.ReleaseDate, MainListTbl.AlbumSingle FROM MainListTbl where MainListTbl.ARTIST='" & SortArt & "' And MainListTbl.ALBUMSINGLE='" & SortFormat & "' Group By MainListTbl.TITLE, MainListTbl.ReleaseDate, MainListTbl.AlbumSingle Order By " & SortOrder
  26.  
  27. 'End of new code
  28. '***********************************************************************
  29. Set objRS=objConn.Execute(Sql)
  30. %>
  31. <html>
  32.  
  33. <head>
  34. <style TYPE="text/css"> 
  35. <!-- 
  36. A:LINK, A:VISITED, A:ACTIVE { text-decoration: none } 
  37. //--> 
  38. </style> 
  39. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  40. <title>Eurythmics Singles</title>
  41. <base target="main">
  42. <script language="javascript">
  43. function sortpage(v){
  44. window.location='<%=Request.ServerVariables("Script_Name")%>?Artist=<%=SortArt%>&AlbumSingle=<%=SortFormat%>&SortBy='+v
  45. }
  46. </script>
  47.  
  48. <script language="javascript">
  49. function setframes(m,t,b)
  50. {
  51. parent.document.getElementById("I2").src = m 
  52. parent.document.getElementById("I3").src = t 
  53. parent.document.getElementById("I4").src = b
  54. }
  55. </script>
  56. <meta name="Microsoft Theme" content="eurythmics 1011, default">
  57. </head>
  58.  
  59. <body topmargin="1" leftmargin="1" rightmargin="1" bottommargin="1" marginwidth="1" marginheight="1">
  60.  
  61.  
  62.  
  63. <b>
  64.  
  65. <font face="Trebuchet MS" style="font-size: 9pt">
  66. <font color="<%=AZColour%>">
  67. <font color="#800000">Sort By</font><a target="_self" class="AZ" href="javascript:sortpage('');">&nbsp;<font color="#808080">A-Z</font></a></font><font color="#800000">&nbsp;or</font><font color="<%=ReleaseColour%>"><a target="_self" class="Rel" href="javascript:sortpage('ReleaseDate');"><font color="#800000"> </font>
  68. <font color="#808080">Release Date</font></a></font></font><font color="#808080" face="Trebuchet MS" style="font-size: 9pt">
  69. </font>
  70. <font face="Trebuchet MS" style="font-size: 9pt">
  71. <br><br>
  72. <%
  73. Do until objRs.EOF
  74. Response.Write("<a target=""_self"" href=""javascript:setframes('title.asp?Title=" & Server.HTMLEncode(objRS("TITLE")) & "&format=" & Server.HTMLEncode(objRS("ALBUMSINGLE")) & "','chartdetails.asp?Title=" & Server.HTMLEncode(objRS("TITLE")) & "&format=" & Server.HTMLEncode(objRS("ALBUMSINGLE")) & "','../../../reviews/reviews.asp?Title=" & Server.HTMLEncode(objRS("TITLE")) & "');"">" & trim(UCASE(objrs("Title"))) & "</a><br>")
  75. objrs.movenext
  76. loop
  77. %>
  78. </font>
  79. <div id="staticbuttons" style="position:absolute;">
  80. <font face="Trebuchet MS" style="font-size: 9pt">
  81. <a href="javascript:" onmouseover="myspeed=-thespeed" onmouseout="myspeed=0"><img
  82. src="http://www.eurythmics.me.uk/websitegraphics/arrows_up.gif" border="0"></a><br>
  83. <a href="javascript:" onmouseover="myspeed=thespeed" onmouseout="myspeed=0"><img
  84. src="http://www.eurythmics.me.uk/websitegraphics/arrows_dn.gif" border="0"></a>
  85. </font>
  86. </div>
  87.  
  88. <font face="Trebuchet MS" style="font-size: 9pt">
  89.  
  90. <script>
  91.  
  92. //Page Scroller (aka custom scrollbar)- By Dynamic Drive
  93. //For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
  94. //This credit MUST stay intact for use
  95.  
  96. var Hoffset=30 //Enter buttons' offset from right edge of window (adjust depending on images width)
  97. var Voffset=470 //Enter buttons' offset from bottom edge of window (adjust depending on images height)
  98. var thespeed=3 //Enter scroll speed in integer (Advised: 1-3)
  99.  
  100. var ieNOTopera=document.all&&navigator.userAgent.indexOf("Opera")==-1
  101. var myspeed=0
  102.  
  103. var ieHoffset_extra=document.all? 15 : 0
  104. var cross_obj=document.all? document.all.staticbuttons : document.getElementById? document.getElementById("staticbuttons") : document.staticbuttons
  105.  
  106. function iecompattest(){
  107. return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
  108. }
  109.  
  110. function positionit(){
  111. var dsocleft=document.all? iecompattest().scrollLeft : pageXOffset
  112. var dsoctop=document.all? iecompattest().scrollTop : pageYOffset
  113. var window_width=ieNOTopera? iecompattest().clientWidth+ieHoffset_extra : window.innerWidth+ieHoffset_extra
  114. var window_height=ieNOTopera? iecompattest().clientHeight : window.innerHeight
  115.  
  116. if (document.all||document.getElementById){
  117. cross_obj.style.left=parseInt(dsocleft)+parseInt(window_width)-Hoffset+"px"
  118. cross_obj.style.top=dsoctop+parseInt(window_height)-Voffset+"px"
  119. }
  120. else if (document.layers){
  121. cross_obj.left=dsocleft+window_width-Hoffset
  122. cross_obj.top=dsoctop+window_height-Voffset
  123. }
  124. }
  125.  
  126. function scrollwindow(){
  127. window.scrollBy(0,myspeed)
  128. }
  129.  
  130. function initializeIT(){
  131. positionit()
  132. if (myspeed!=0){
  133. scrollwindow()
  134. }
  135. }
  136.  
  137. if (document.all||document.getElementById||document.layers)
  138. setInterval("initializeIT()",20)
  139.  
  140. </script>
  141. </b>
  142. </body>
  143.  
  144. </html>
  145.  
Apr 27 '08 #1
Share this Question
Share on Google+
5 Replies


DrBunchman
Expert 100+
P: 979
Hi loveshack,

You haven't actually said what the problem is! What doesn't work in Firefox and Safari - is it layout or are you actually geting an error? If so what is it?

Also, your link didn't work - can you check it for me?

I'm happy to help once I know what the problem is! :-)

Dr B
Apr 28 '08 #2

P: 2
Hi Dr. B

Sorry about the link, here it is again

[HTML]http://www.eurythmics.me.uk/Discography/Artists/EurythmicsMainDiscog.htm[/HTML]

Basically after selecting a record from the top menu, a list appears in the left hand frame, the centre frame will get populated when you click on any of the titles, and once that frame is populated, either selecting an image or hyperlink the far right hand frame populates - Everything works fine in IE, but in Firefox and Safari, nothing appears in the centre frame, no obvious error messages anywhere.

Many thanks!

Steve
Apr 28 '08 #3

DrBunchman
Expert 100+
P: 979
Hi Steve,

Have you got Firebug installed on your version of Safari? It's a really handy Javascript debugger that you can download for free from the Mozilla website.

After browsing your page using FireFox, Firebug came up with these two errors:

missing ; before statement

on the following line. I think it might be the two double quotes you've got before the url that are causing the problem.
Expand|Select|Wrap|Line Numbers
  1.  
  2.  <script type="text/javascript">var dmWorkPath = ""http://www.eurythmics.me.uk/discography/artists/eurythmicsdiscog.files/";</script>
  3.  
And parent.document.getElementById("I2") has no properties

on the following line.
Expand|Select|Wrap|Line Numbers
  1.  
  2. parent.document.getElementById("I2").src = m
  3.  
I'm not 100% sure about this one but it might be that you need to do something like the following:

Expand|Select|Wrap|Line Numbers
  1.  dim var 
  2. var = parent.document.getElementById("I2")
  3. var.src = m
  4.  
I'm not a Javascript expert but you might find that something like the above will work for you.

Let me know how you get on with these errors and I'd suggest you install Firebug as you'll find it a big help debugging your scripts.

Hope this helps,

Dr B
Apr 28 '08 #4

drhowarddrfine
Expert 5K+
P: 7,435
I'm just now getting back into js so ....

Is parent.document... correct nowadays? I thought we were to use only document dot etc.
Apr 29 '08 #5

drhowarddrfine
Expert 5K+
P: 7,435
In any case, you have misplaced meta tags and other errors that need fixing. The error console says you are sending CSS as text/html, too.

Use a modern browser to test your pages in. Don't trust IE. Firefox has the excellent Firebug debugger which you should use.
Apr 29 '08 #6

Post your reply

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