WoW Gold - Secured Loans - Watch Anime - Wordpress Themes - Manga

PDA

View Full Version : question document.write(' ');


arale
Mar 20th 2008, 7:24 pm
Hi

I have a small trouble with document.write(' '); Could you explain for me?

I want to create a content/image and allow people copy a javascript file and it will show on their site. So I have show.js


document.write('<link href="http://www.domain.com/css.css" rel="stylesheet" type="text/css" />');

document.write('<a href="http://www.domain.com/" name="corner" target="_blank" id="corner" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="http://www.domain.com/image.png",sizingMethod="scale");">Click here</a>');


Then I put <script type="text/javascript" language="javascript" src="http://www.domain.com/show.js"></script> to HTML code. Result show on Firefox is ok but on IE6, it doesnt work. In IE, it shows background only, not show image. I dont know how to fix :confused:, could some one help me please.

This is CSS:

body {
background-color: #0099FF;
}
a#corner {
position: absolute;
right: 0;
top: 0;
display: block;
height: 90px;
width: 100px;
background: url(image.png) top right no-repeat !important;
background: none;
text-indent: -999em;
text-decoration: none;
cursor: hand;
}


Thanks

vpguy
Mar 21st 2008, 5:05 pm
In your CSS you have:

background: url(image.png) top right no-repeat !important;

followed immediately by:

background: none;

Try getting rid of background:none;. It makes no sense to have both of them. IE is probably ignoring the !important attribute and just using the background:none; since it is parsed last.

arale
Mar 21st 2008, 6:29 pm
I have fixed it, it works now :) Anyway, thank you


a#support {
position: absolute;
right: 0;
top: 0;
display: block;
height: 90px;
width: 100px;
background: url('image.png') top right no-repeat !important;
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='image.png');
background: none;
text-indent: -999em;
text-decoration: none;
cursor: hand;
}

vpguy
Mar 21st 2008, 7:35 pm
That's a pretty bizarre way to go about it "fixing" it. If your goal is to have a background image displayed on the <a>, I would recommend correcting your existing CSS code rather than applying duct tape and band-aids.