473,394 Members | 1,971 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

CSS ASP expected ')'

Hi,

I am having a heck of a time trying to figure this one out. I am not a pro with CSS or ASP. I know VBScript fairly well.

There is a Expected ')' error in the line with the "a href" between the two <li> tags. It has to do with how I am trying to display the Description to screen.

What I am trying to do is display the description of the image and then when you hover/mouse over the description the image will appear.

Thanks for any help you can offer.

I managed to do this with an image preview, but switching this to text it isn't working.
Here is where I got the image working from:
http://host.sonspring.com/hoverbox/
main site:
http://sonspring.com/journal/hoverbox-image-gallery

Working code for the image preview:

Response.Write ("<tD ALIGN=""CENTER"" BGCOLOR=#FFFFFF>")
Response.Write ("<li>")
Response.Write ("<a href=""#"">
<img src=""Image_Web_Gallery\Image_" & rsGetRecords("StaticImageTimedNumber") & ".jpg"" /><img src=""Image_Web_Gallery\Image_" & rsGetRecords("StaticImageTimedNumber") & ".jpg"" class=""preview"" /></a>")
Response.Write ("</li>")
Response.Write ("</tD>")

What I am trying to do:

Response.Write ("<tD ALIGN=""CENTER"" BGCOLOR=#FFFFFF>")
Response.Write ("<li>")
Response.Write ("<a href=""rsGetRecords("StaticImageTimedDescription") ""> rsGetRecords("StaticImageTimedDescription") <img src=""Image_Web_Gallery\Image_" & rsGetRecords("StaticImageTimedNumber") & ".jpg"" class=""preview"" /></a>")
Response.Write ("</li>")
Response.Write ("</tD>")
Jan 30 '08 #1
13 3154
drhowarddrfine
7,435 Expert 4TB
I think you might have your quotes mismatched but this is an asp problem so I'll send this there.
Jan 30 '08 #2
CroCrew
564 Expert 512MB
hello johneecc,

Have a look at this:

Expand|Select|Wrap|Line Numbers
  1. <html>
  2.     <head>
  3.     <title>Example</title>
  4.     <style type="text/css" media="screen, projection">
  5.         .hoverbox
  6.         {
  7.             cursor: default;
  8.             list-style: none;
  9.         }
  10.  
  11.         .hoverbox a
  12.         {
  13.             cursor: default;
  14.             position: relative;
  15.         }
  16.  
  17.         .hoverbox a .preview
  18.         {
  19.             display: none;
  20.         }
  21.  
  22.         .hoverbox a:hover .preview
  23.         {
  24.             display: block;
  25.             position: absolute;
  26.             z-index: 1;
  27.             top: -38px;
  28.             left: -50px;
  29.         }
  30.  
  31.         .hoverbox img
  32.         {
  33.             background: #fff;
  34.             border-color: #aaa #ccc #ddd #bbb;
  35.             border-style: solid;
  36.             border-width: 1px;
  37.             color: inherit;
  38.             padding: 2px;
  39.             vertical-align: top;
  40.             width: 100px;
  41.             height: 75px;
  42.         }
  43.  
  44.         .hoverbox li
  45.         {
  46.             background: #eee;
  47.             border-color: #ddd #bbb #aaa #ccc;
  48.             border-style: solid;
  49.             border-width: 1px;
  50.             color: inherit;
  51.             display: inline;
  52.             float: left;
  53.             margin: 3px;
  54.             padding: 5px;
  55.             position: relative;
  56.             position: static;
  57.         }
  58.  
  59.         .hoverbox .preview
  60.         {
  61.             border-color: #000;
  62.             width: 200px;
  63.             height: 150px;
  64.         }
  65.  
  66.         .hoverbox a:hover
  67.         {
  68.             display: block;
  69.             font-size: 100%;
  70.             z-index: 1;
  71.         }
  72.  
  73.     </style>
  74.     </head>
  75.     <body>
  76.         <%
  77.             Response.Write("<table width='500' align='center'><tr><td><ul class='hoverbox'>")
  78.                 Response.Write("<li>")
  79.                 Response.Write("<a href='#'>")
  80.                 Response.Write("<img src='Image_Web_Gallery\Image_" & rsGetRecords("StaticImageTimedNumber") & ".jpg'>"
  81.                 Response.Write("<img src='Image_Web_Gallery\Image_" & rsGetRecords("StaticImageTimedNumber") & ".jpg' class='preview'></a>")
  82.                 Response.Write("</li>")
  83.             Response.Write("</ul></td></tr></table>")
  84.         %>
  85.     </body>
  86. </html>
  87.  
  88.  
Jan 30 '08 #3
Thanks for the reply, but that looks just like what I had.

I am just trying to display the description from a DB recordset of the image.
Originally, I had a thumbnail image and the preview was when the mouse hovered over it.

See code below:
I am able to display the default test text of "Image Preview", but when I plug in rsGetRecords("StaticImageDescription") I get the Expected ')' error.

Response.Write ("<a href=""#""> Image Preview <img src=""Static_Image_Web_Gallery\Image_" & "00" & rsGetRecords("StaticImageTimedNumber") & ".jpg"" class=""preview""/></a>")
Jan 30 '08 #4
CroCrew
564 Expert 512MB
whatt is in rsGetRecords("StaticImageDescription")? Can you give an example.

Thanks~
Jan 30 '08 #5
This is a description of the image coming from an Access DB. It is only text.
Jan 30 '08 #6
rsGetRecords is a recordset for retreiving from the DB. I am looping through using vbscript to display the info.
Jan 30 '08 #7
CroCrew
564 Expert 512MB
Yes, I understand that. What I was asking is if you can give us an example of one of the records in your recordset.
Jan 30 '08 #8
DrBunchman
979 Expert 512MB
I would hazard a guess that there is a double quote or other special character somewhere in one of your records.

I suggest you run the query in a query analyzer and check the records returned for any double quotes or other characters.

Let us know how you get on,

Dr B
Jan 31 '08 #9
What is the rule on quotes or double quotes?

For instance, by adding the double quotes made this line work:
<img src=""Image_Web_Gallery\Image_" & rsGetRecords("StaticImageTimedNumber") & ".jpg"" class=""preview"" /></a>")

I do not think it is a quote coming back from a record because I am able to display the image description before I was trying to link it up with the actual image.
Here is that line:
Response.Write ("<b>" & rsGetRecords("StaticImageTimedDescription") & "&nbsp;</b>")

Here are some of the records:
Seattle Seahawks
Pittsburgh Steelers
Houston Texans
Tennessee Titans

Thanks for all your help too it is greatly appreciated.
Jan 31 '08 #10
DrBunchman
979 Expert 512MB
John,

Is the code you printed in your first post your actual working code? If so I think there is a little error which may be causing your problem. You wrote:

Expand|Select|Wrap|Line Numbers
  1. Response.Write ("<a href=""rsGetRecords("StaticImageTimedDescription")""> rsGetRecords("StaticImageTimedDescription") <img src=""Image_Web_Gallery\Image_" & rsGetRecords("StaticImageTimedNumber") & ".jpg"" class=""preview"" /></a>")
This needs to be changed to:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Response.Write("<a href=""" & rsGetRecords("StaticImageTimedDescription") & """>" & rsGetRecords("StaticImageTimedDescription") & "<img src=""Image_Web_Gallery\Image_" & rsGetRecords("StaticImageTimedNumber") & ".jpg"" class=""preview"" /></a>")
  3.  
Notice there are a couple more &'s in my version which are joining the strings and the requests together. By leaving out the &'s the string will think it has finished and expect a closing parenthesis ) .

Give that a try and let us know how it goes.

Cheers,

Dr B
Jan 31 '08 #11
DrBunchman
979 Expert 512MB
And in answer to your question about quote marks:

A double quote (") marks the beginning and end of a string. If you want to place a double quote inside a string you need to use two double quote marks (""). These are interpreted as one double quote mark inside the string.

However note that in most instances you can use a single quote inside a string instead of two doubles e.g

Response.Write("<img src=""test.jpg"" alt=""test"" />")

Can be re-written as:

Response.Write("<img src='test.jpg' alt='test' />")

Which looks much cleaner!

Hope this helps,

Dr B
Jan 31 '08 #12
CroCrew
564 Expert 512MB
Hello johneecc,

I would stay very clear from using double quotes. It is too easy to get turned around using them. My example above does not use them and when I tested it the results work for me. If it did not work for you then I think what DrBunchman said might be true in that something in your data is corrupt. Did you try out the example above?

Have a good day~
Jan 31 '08 #13
DrBunchman, what you listed worked. aaaaahhhhh Thank you for solving my issue.
I also tried using the single quotes too and it also worked. Thank you for explaining the difference between all the quotes.

CroCrew thanks for all your help too. Greatly appreciated.
Jan 31 '08 #14

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

Similar topics

4
by: Bill | last post by:
I call a function in my .js file like this: onClick="location.href='blank.html' + generateSearchStringFromForm('section')" where section is the name of my form. The function is defined as...
5
by: andy.herrera | last post by:
I'm getting this Error Message. Expected ';' Please Select One: <form name="form1"> <<------------ Error is here. <select name="selectTrans" onChange="If (this.value == 'checkout')...
3
by: Jon | last post by:
I'm learning about datatables. When using the example provided by MS in the ..NET Framework Class Library for DATATABLE (see below) I get an error on line 3 that says "Type expected". Is something...
7
by: Warrax | last post by:
I am currently doing online tutorials for C++, and am pretty much stuck in a rut about this problem. It is saying that there's an expected unqualifed-id before '{' token (I will post the code in just...
1
by: JOJO123 | last post by:
I got here in search of an answer to this Javascrpt question. I upgraded jave on XP Ie 7, acrobat 5.1 and suddenly can't open any pdf files on web sites using IE. I see u guys all say, this is a...
6
by: Lawrence Spector | last post by:
I ran into a problem using g++. Visual Studio 2005 never complained about this, but with g++ I ran into this error. I can't figure out if I've done something wrong or if this is a compiler bug. ...
5
by: amitmool | last post by:
hi, i have used the queue library file and try to use the template as template <class QueueItem> queue <QueueItem>::~queue() // line 25 { } template <class QueueItem> void...
1
by: Hunternora | last post by:
I'm just trying to count letters, by type etc. What am I doing wrong here? import javax.swing.JOptionPane; public class Asg3 { public static void main(String args) { int aCount=0,...
10
by: preeya | last post by:
Hi, I have written the following program: ------------------------------------------------------------------------------------------------------------- 1 #include <stdio.h> 2 #include...
9
by: erictheone | last post by:
Ok so what I'm trying to do is create a trans location cipher. For those among us that don't know alot about cryptography it is a method for jumbling up letters to disguise linguistic...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.