-
- CommentAuthor4evrblu
- CommentTimeJan 24th 2007
Build it and they will come
Ok here is my first photo tutorial. Wowo, that was a HUGE amount of work. Especially because of the highslide script.
My issue is still the thumbnail styles. I have all the styles in place in the style sheet, but still the thumbnails are not taking on the attributes. I have gone over this and over this and I ain't getting it.
Anyway, the tutorial is fairly cool. It's not perfect but hell, I am not getting paid for this yet. LOL
Can anyone figure out why the nails are so stubborn. There is a cookie in it for you if you do.
-
-
CommentAuthoricyone
- CommentTimeJan 24th 2007
I show a error in Firebug the FF extension but I have no idea what it means or if it will help. Here it is.missing ; before statement
all-spice.js (line 9)
<script type="text/javascript"> -
-
- CommentAuthor4evrblu
- CommentTimeJan 24th 2007 edited by 4evrblu on the 24th January 2007 at 12:15:36 EST
What the heck does that mean??? Now I am more befuddled than ever. Yeah, I admit it, I get fuddled easily.
But "Before statement?" What the...
No cookie for you!
heheheheheh
-
-
CommentAuthoricyone
- CommentTimeJan 24th 2007 edited by icyone on the 24th January 2007 at 12:40:31 EST
I have no idea either hehe. But when I visited your page the little error x said "befuddle 4evrblu." Do you use firefox. If you do get the extension snop mentioned firebug and it seems to have a JS debugger.Debug and profile JavaScript
Firebug includes a powerful JavaScript debugger that lets you pause execution at any time and have look at the state of the world. If your code is a little sluggish, use the JavaScript profiler to measure performance and find bottlenecks fast.
I'll just get my own bakie.
-
-
- CommentAuthorDraicone
- CommentTimeJan 24th 2007
It means there's an error in your Javascript code. After a quick glance I couldn't see anything wrong, but look for a semicolon at the end of every line. You can also use the Web Developer toolbar for Firefox to analyse these things, I find it's far more in depth and effective than Firebug. -
-
CommentAuthorChristopher
- CommentTimeJan 24th 2007
I looked at the source of JavaScript manually and found the problem within 10 seconds...function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
Find the above, see the second line, it's missing the closing ; at the end of the line. So replace the above code with:function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++);
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
Then it will be fine. Simple as to be honest. -
-
- CommentAuthorDraicone
- CommentTimeJan 24th 2007 edited by Draicone on the 24th January 2007 at 15:14:20 EST
No hang on, it certainly won't be fine. A for loop needs a statement to execute while the second argument returns true. It's a case structure. You can't just stick a semicolon everywhere, you need curly braces instead.
Replace it with this:
function MM_preloadImages() {
var d=document;
if(d.images) {
if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
for(i=0; i<a.length; i++) {
if (a[i].indexOf("#")!=0) {
d.MM_p[j]=new Image;
d.MM_p[j++].src=a[i];
}
}
}
}
Then, while I'm not so sure it'll be fine (it looks rather dodgy as it is), it'll at least by syntactically correct.
[edit] The problem wasn't the missing semicolon, rather the extra statement after the for loop. A case structure doesn't need curly braces if it only has one statement (or a case structure - recursively correct).
Oh, and chris - never trust an error message :) I once got a "Parse error: parse error, unexpected ')', expecting T_PAAMAYIM_NEKUDOTAYIM in C:\wamp\www\email.php on line 3" -
- CommentAuthor4evrblu
- CommentTimeJan 24th 2007
Posted By: DraiconeIt means there's an error in your Javascript code. After a quick glance I couldn't see anything wrong, but look for a semicolon at the end of every line. You can also use the Web Developer toolbar for Firefox to analyse these things, I find it's far more in depth and effective than Firebug.
Wow. That Web Developer is powerful. You definately get a cookie.
@Chris.....You too.... a cookie
And @icyone, I am even given you one.
They are fresh baked, and I wish to thank you all.
Now, some of you may have noticed that the cookies look as though they have been licked, and the raisins picked out of them. Ummm.....just ignore that. Trust me, they are good. -
-
CommentAuthorChristopher
- CommentTimeJan 24th 2007 edited by Christopher on the 24th January 2007 at 16:28:08 EST
*sighs*Posted By: DraiconeOh, and chris - never trust an error message :) I once got a "Parse error: parse error, unexpected ')', expecting T_PAAMAYIM_NEKUDOTAYIM in C:\wamp\www\email.php on line 3"
I hope you do realise that "expecting T_PAAMAYIM_NEKUDOTAYIM" is actually a valid error though, don't you? Certain functions that expect variables such as “isset†followed by a non-string, non-integer word will cause this error. For example:isset(where_is_the_dollar_sign);
There is also the opposite which is "unexpected T_PAAMAYIM_NEKUDOTAYIM" which means you have an unexpected double colon (::) in your code. -
-
- CommentAuthorDraicone
- CommentTimeJan 24th 2007
Yes, I understand it's a valid error, I fixed it when I saw it, but it's not exactly the most descriptive
And in this instance the for loop does need the curly braces because it has to enclose successive statements involving more than one command. This code:
<code>for(i=0; i<a.length; i++);</code>
Is certainly, while probably valid, redundant and incorrect. If you omit the curly braces you have to have the actual statement immediately afterwards, as I'm sure you're familiar with. The semicolon terminates the command. If the d.MM_p[j++].src=a[i]; line didn't exist, though, it could all be shortened to for(i=0; i<a.length; i++) if(a[i].indexOf("#")!=0) d.MM_p[j]=new Image;. -
- CommentAuthor4evrblu
- CommentTimeJan 24th 2007 edited by 4evrblu on the 24th January 2007 at 16:30:40 EST
OK, I decided to check http://totalphysiqueonline.com/wordpress/wp-content/themes/fjords01-10/js/all-spice.js again and this is what I found:Error: missing ; before statement
Source File: http://totalphysiqueonline.com/wordpress/wp-content/themes/fjords01-10/js/all-spice.js
Line: 9, Column: 8
Source Code:
<script type="text/javascript">
Now, I looked at the source code in my editor, but line is only the beginning of the script.
Could someone tell me what a "statement" is or how you identify one?
Is a statement in javascript this "()". That is how I have always identified them, but I am still sort of muddling my way through js and learning as I go along.
If I am correct, and () is a statment, then should all instances of "()" be followed by ";"
There were several instances of () that had no ; after them.
Chris, don't worry...I know you have a lot on your mind. Let the other folks chime in. I saw what happened with your blog when 2.1 blew your site up, more or less. So, focus on your own stuff and get your blog fixed. :) -
- CommentAuthorDraicone
- CommentTimeJan 24th 2007 edited by Draicone on the 24th January 2007 at 17:10:40 EST
Actually, forget all that. Here's the actual error in your code. You are including wordpress/wp-content/themes/fjords01-10/js/all-spice.js as a script file. However, if you include it as a script file, it has to include pure JavaScript. Sometimes browsers let you get away with one set of script tags in the .js file. The problem is when it encounters this://-->
</script>
<script type="text/javascript">
<!--
Now, this is the part of the actual page source where it includes the .js file:<script language="javascript" type="text/javascript"
src="/wordpress/wp-content/themes/fjords01-10/js/all-spice.js"></script>
By including that file, which has closing script tags followed by opening script tags inside, this is the effective result:<script language="javascript" type="text/javascript"
src="/wordpress/wp-content/themes/fjords01-10/js/all-spice.js">
<script type="text/javascript" language="JavaScript">
<!--
// Some code
//-->
</script>
<script type="text/javascript">
<!--
// Some code
//-->
</script>
<script type="text/javascript" language="JavaScript">
<!--
// Some code
//-->
</script>
<script type="text/javascript" language="javascript">
<!--
// Some code
//-->
</script>
</script>
So, you're effectively including javascript files which declare javascript html within themselves. Javascript doesn't halt on error so it shouldn't be much of a problem unless the tags break the parsing of the subsequent code.
Solution: Open wordpress/wp-content/themes/fjords01-10/js/all-spice.js and get rid of all the <script> and script> tags. Somehow I still doubt that will solve your problem, but it's a start.
Oh, and a statement is any command in Javascript. It could be something with parenthesis, or it could have an equals sign, but it's generally on its own line and has a semicolon on the end. Things like if(), for(), while(), else() are called case structures, and don't need semicolons, but generally have semicolons on the ends of the things inside them / after them. (Note: The semicolon is optional in Javascript!) -
- CommentAuthor4evrblu
- CommentTimeJan 24th 2007 edited by 4evrblu on the 24th January 2007 at 16:35:59 EST
ok i will look at it. -
-
CommentAuthoricyone
- CommentTimeJan 24th 2007 edited by icyone on the 24th January 2007 at 16:42:08 EST
Christopher and 4evrblu no errors now with firebug. Yippee... -
-
- CommentAuthor4evrblu
- CommentTimeJan 24th 2007 edited by 4evrblu on the 24th January 2007 at 16:59:37 EST
So Draicone, afre you saying essentially this.....
That a js file that has <script> tags in it, which is then included in a header tag where additional <script> tags are used to enclose it, is like enclosing a hypertext link within a hypertext link?
For example:<a href="<a href="http://totalphysiqueonline.com/">http://totalphysiqueonline.com/</a></a>
Sort of like that? In other words, not only is it redundant, and hence unnecessary, but could possible slow the code down or break it?
That seems to make sense to me.
I had actually suspected that a few weeks ago when I created the js file to begin with. But my solution was to simply remove the first and last <script> tags in the js file, as opposed to yanking all of them out, and that broke the code. So I assumed I was on the wrong path. The truth is I just needed to take it a step further and take them all out.
Well, I just did that and tested it in FF and guess what? The errors are gone.
I learned something good today.


for everyone! 
-
- CommentAuthor4evrblu
- CommentTimeJan 24th 2007
Funny thing is, as tremendously educational and eye opening as this thread is, has anyone noticed just how far off topic we have gotten. LOL
Funny.
Cuz' I originally asked if anyone could make sense out of my misbehaving style sheet and thumbnails. LOL
By the way, my thumbnails are still entirely style-less
:D -
- CommentAuthorDraicone
- CommentTimeJan 24th 2007 edited by Draicone on the 24th January 2007 at 17:23:13 EST
Yes, your example of an anchor within an anchor is exactly what I meant.
And yes, we're terribly off topic here, what with petty disputes on coding practices and recursive <script> tags. Could you repeat the question?
I'll take a look at your CSS and see where the problem is.
[Update] I took a look at your stylesheet, and it has some real problems right from square one. What exactly was this?.post img.highslide {
border: 2px solid gray;
}
.post img.highslide {
border: 2px solid white;
}
Pick a border color and stick to it =P
Now, what is the CSS you want to have on your thumbnails? In increasing order of importance, the styles that would be applied to your thumbnails are:
* html
* body
* #wrapper
* #content
* #pagina
* .post
* p
* a #image257 .highslide
* img .highslide
(This is just an example for one thumbnail)
Have you declared a class or something anywhere that should affect these thumbnails but is not listed here? If so, you haven't properly linked it to the thumbnails.
Next, is there something wrong with the thumbnail presentation? Could you tell me what you expected them to appear like?
And finally, which CSS sheets are you editing to attempt to change the thumbnails anyway? -
- CommentAuthor4evrblu
- CommentTimeJan 24th 2007 edited by 4evrblu on the 24th January 2007 at 17:50:22 EST
Good questions one and all.
One, the two styles you displayed were after the fact. Here is what I initially had instead of those two styles:.highslide img {
border: 2px solid gray;
}
.highslide:hover img {
border: 2px solid white;
}
But those were not being called for some reason. Since the images appeared in .post, I thought I had better change it to something like:.post .highslide img{
border: 2px solid gray;
}
.post .highslide:hover img{
border: 2px solid blue;
}
Only I was uncertain how to code it and in my confusion I totally muffed it, so the result is what you found.
I would like all the thumbnails within that particular post to look the same, with a 2 px border, grey, and a hover color of anything other than white. Maybe Gold or something. I dunno, just not white.
Does that help clear up the picture somewhat? -
- CommentAuthor4evrblu
- CommentTimeJan 25th 2007
Draicone, does the above reply make more sense to you? -
-
CommentAuthorJJenZz
- CommentTimeJan 26th 2007 edited by JJenZz on the 26th January 2007 at 04:18:24 EST
I haven't looked at the CSS but looking at the HTML, the original CSS was correct. At a guess, it probably wasn't working because something may have been over ruling it later on in the CSS file.
!important helps in these situations.
Try this:a.highslide img {
border: 2px solid gray !important;
}
a.highslide:hover img {
border-color: blue !important;
} -
-
- CommentAuthor4evrblu
- CommentTimeJan 26th 2007
Well, that did not work either. But guess what.....post .highslide img{
border: 3px solid grey !important;
}
.post .highslide:hover img{
border: 3px solid black !important;
}
This did.


Thank you so much.
1 to 21 of 21
