View Full Version : Noscript messing with CSS


rarebit
05-11-2008, 16:34
Hi,
I'm developing a small site and the homepage works fine, but when I use noscript on Firefox it repeats the css blocks but without their wrapper (so it's 100% page height). It doesn't do it with Opera and i'm not able to check with IE at the moment. Has anyone got any ideas why this is happening in FF (or is it just my version 2.0.0.17 on Fedora8 ).

See here (http://hypno.monkies.co.uk/).

liam1412
05-11-2008, 17:12
If you mean the blocks with the color change in, Looks fine to me on FF3 - Win XP

Or did you fix it already

liam1412
05-11-2008, 17:14
Edit, Also seems to be okay in IE7 but the last block goes onto the next line.

rarebit
05-11-2008, 17:17
It's when I block the js that the extra blocks appear?


next line, hmmm, no idea, it adds upto 100%, if I do less it'll be odd, i'll have a look though.

Cheers

liam1412
05-11-2008, 17:18
Its to do with the block element error in IE I think

Pain in the ass is IE.

rarebit
05-11-2008, 18:17
Its to do with the block element error in IE I think

Pain in the ass is IE.

I think thats something to do with how either margin or padding is drawn inside out, or something... I've gone for a cheeky fix but should render correctly so who cares whines... Actually thats me, it didn't work like I expected! I'll have to boot up windows sometime and fix that.


Still no joy on the extra blocks though... it all validates well enough?

rarebit
06-11-2008, 22:18
The IE issue should have been resolved now, but not checked.

But still not found out why the blocks are appearing when js is turned off when using FF?

liam1412
06-11-2008, 22:46
Not to seem to be the constant bearer of bad news but the IE bug is still there. Sorry

rarebit
06-11-2008, 22:48
Love it!

I'll have to do it when i'm on windoze!

Cheers...

liam1412
06-11-2008, 22:50
No worries.

rarebit
06-11-2008, 22:57
Surely that's (http://www.talkaboutfishing.co.uk/viewimg.php?imgid=19) not real!

liam1412
06-11-2008, 22:59
Just a baby that. :hihi:

rarebit
06-11-2008, 23:10
Here's what i'm seeing, http://hypno.monkies.co.uk/ff.png. I just can't work out why?

maggi
06-11-2008, 23:19
The DOM Inspector (https://addons.mozilla.org/en-US/firefox/search?q=dom+inspector&cat=all) add-on for Firefox might help you diagnose this.

ETA: Aargh! Or it might if you could get a version that worked with FF2:( Sorry.

rarebit
06-11-2008, 23:32
Having had a look with DOM Inspector it shows that the blocks are repeated within the body at the end, then checking the source as provided by FF, they don't exist. However i'm just bring another site upto noscript standard and I notice that it lists an array of images which are supposedly not loaded at the end of the page. Maybe it is a noscript proxy include / exclude thing... mmm, I have a few tests to try!

(I hope)
Many thanks!

rarebit
06-11-2008, 23:39
Yes, definitely a noscript issue, if I disable noscript and restart, then disable js in ff, it does as it should. But if I disable js in FF and re-enable noscript, all the pages just keep reloading, very weird...

I'll submit a bug report and worry no more for now...

Many thanks!

John
07-11-2008, 01:28
Having looked at your code I can't see the </noscript> tag

Also, someVariable.toString(16); is same as byte2Hex(someVariable).

rarebit
07-11-2008, 01:49
yes the </noscript> did seem to have got lost along the way, he's found now cheers.

I've tried some variations on the tostring(16) bit but none seem to work yet, the int one sort of works but the output needs to be to two places (e.g. with leading 0):


//return '#' + r.toString().toString(16) + g.toString().toString(16) + b.toString().toString(16);
//return '#' + toString(r).toString(16) + toString(g).toString(16) + toString(b).toString(16);
//return '#' + String(r).toString(16) + String(g).toString(16) + String(b).toString(16);
//return '#' + r.toString(16) + g.toString(16) + b.toString(16);
return '#' + parseInt(r).toString(16) + parseInt(g).toString(16) + parseInt(b).toString(16);


I'll have a look into it tomorrow...

Cheers (always like built in functions!)

John
07-11-2008, 02:15
OK, doing individually won't work

This is untested, but should do it.

function rgb2color(r,g,b)
{
return "#" + parseInt(((r & 0xFF) << 16) | ((g & 0xFF) << 8) | (b & 0xFF)).toString(16);
}

I'd probably be better off keeping my mouth shut after seeing that equation.

If you can ensure that r,g,b is never over 255 then you can get rid of the & 0xFF part