/    Sign up×
Community /Pin to ProfileBookmark

help with – document.write

How would I do this

[code]
<td colspan=”2″ background=”./themes/Glossy/topbar.jpg” width=”100%”>
[/code]

needd it to be something like

[code]
<script language=”javascript”>
document.write(“<td background=’./Themes/” + Theme + “/topbar.jpg’ width=”100%”>”);
</script>
[/code]

Also I need these line to also point to the files the same way.

[code]
<a href;
onMouseDown=”document.continuebutton.src=’./themes/Glossy/continuedown.gif’;”
onMouseOver=”document.continuebutton.src=’./themes/Glossy/continueover.gif’; stm(getText(ttInstall),Style[0]);”
onMouseOut=”document.continuebutton.src=’./themes/Glossy/continue.gif’; htm();”>
<img
src=”./themes/Glossy/continue.gif”
align=”absbottom”
class=”mainbtn”
border=”0″
name=”continuebutton”
onClick=”StopAudio(); stopInterval(); CreateFile(‘install’);”>
</img>

[/code]

Any Thoughts?

I can’t get these to work for me right!

I got this to work right though

[code]
<script language=”javascript”>
document.write(“<img id=’bgpic’ src=’./Themes/” + Theme + “/Wallpaper.jpg’ width=”100%” height=”100%”>”);
</script>
[/code]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@jalarieJun 06.2006 — Try this:

document.write('<td colspan="2" background="./themes/'+Theme+'/topbar.jpg" width="100%">');
Copy linkTweet thisAlerts:
@phpnoviceJun 06.2006 — How would I do this

<i>
</i>&lt;td colspan="2" background="./themes/Glossy/topbar.jpg" width="100%"&gt;


needd it to be something like
<i>
</i>&lt;script language="javascript"&gt;
document.write("&lt;td background='./Themes/" + Theme + "/topbar.jpg' width="100%"&gt;");
&lt;/script&gt;
[/QUOTE]

Because JavaScript may be disabled, it would actually be better if you did it as follows:
<i>
</i>&lt;td colspan="2" width="100%" id="td7"&gt;
&lt;/td&gt;

&lt;script type="text/javascript"&gt;
document.getElementById("td7").style.backgroundImage="url('./themes/"+Theme+"/topbar.jpg')";
&lt;/script&gt;
×

Success!

Help @almulder spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...