Thanks for helping out Althalos,
but BrCu really gives me what I want.
You see, for each parents('li') jQuery finds a:first, giving me the
array I want.
However, I wonder if the format of the array doesn't convert to insert
as html..
Success!!!
var BrCu = here.parents('li').find("a:first");
var BText = "";
for (i=3; i>=0; i--){
if (BrCu[i] != undefined){
BText = BText + ' > ' + '' + BrCu.eq
(i).html() + '';
}}
$('#breadcumb span.ins').html(BText);
Thank you for your hel
Thanks!
Now we're getting somewhere.
(It's my first time writing a fo-expression)
You're right about the comparison.
It should be: for (i=3; i>=0; i--)
> You're not initializing BText.
I think this is valid..
http://www.w3schools.com/JS/js_variables.asp
It's now writing to the page :))
Howeve
You're not initializing BText.
Also, the comparison part of your "for" loop is wrong: should be "i ==
0", not "i=0".
On Sat, Sep 26, 2009 at 10:36 AM, Geir wrote:
>
> Ok, saw one mistake, overwriting the text on each for.
>
> So, tried this:
> var BrCu = here.parents('li').find("a:first"
Ok, saw one mistake, overwriting the text on each for.
So, tried this:
var BrCu = here.parents('li').find("a:first");
var BText;
for (i=3; i=0; i--){
if (BrCU[i] != undefined){
BText = BText + '> ' + BrCu[i];
}}
$('#breadcumb span.ins').html
I'm not an expert either, so I may be wrong. But I doubt that BrCU
really gives you what you want. find("a:first") will give you ONE
element by definition... it will not return an array of elements. I
think. Probably you need to do something like this:
var el = "";
var BrCu = here.parents('li');
B
Ok, understand the "undefined"-writing..
7 matches
Mail list logo