Embedded javascript being printed?

Hi,

I have a page which when printed — prints out the javascript from my analytics. Everything between the <script> tags.

Javascript that is linked externally is not.

through a process of elimination I have found it is the <base> tag the is causing it. When removed the javascript isn’t printed.

<base href=“http://www.example.co.uk/” />

Anyone know what might be causing this?

Display: inherit on * looks wasteful and possibly a great way to introduce bugs (guess it depends on the display states set on all the elements, but I don’t see why you’d even have to state that).

And I must say I’ve never seen such a thing. I guess it’s a succinct print stylesheet but it’s gotta be a resource hog on the browser. That and I always view my pages with their print stylesheets squished down to 750 px or so because I like things printing out nicely.

And I wonder if * really can override typical names in a stylesheet (I’m assuming you want to override the styles in the screen stylesheet? if you’re not, why the float: none and width: auto stuff? Those are defaults).

Tell me about it. Still, you live and learn. Valid points - thanks for your input.

probably a start-tag end-tag error. have you validated your html?

Thanks noonnope,

The HTML was valid. After some time trying to find the issue I eventually found the problem.

The print stylesheet had the following

* { 
        [B]display:inherit;[/B]
        width: auto;
	height:auto;
	float:none;
	background-color:#fff;
	border:none;
	text-align:left;
	}

This display property was causing the issue. Now I need to work out

  1. if it should be causing the js to print
  2. out why it was there and
  3. if it is really required.

Hope posting this helps someone else out.

Well in any case if removing it removes the bug then that should be ok: Print Preview should show the page looking the same either way.