Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Software Development
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory modem monitor motherboard network printer problem ram registry router security slow software sound toshiba trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Software Development >
javascript document.write simple question

Reply  
Thread Tools
trailerparkboy's Avatar
Member with 35 posts.
 
Join Date: Jun 2006
Experience: Intermediate
29-Jan-2010, 03:58 PM #1
javascript document.write simple question
Hi there,

I'm a copier and paster of javascript and can't seem to figure out how to add some text that will be displayed along with the code.

For example, if javascript consists of this:

Code:
document.write ('<ilayer id=tickernsmain visibility=hide width='+scroller_width+' height='+scroller_height+' bgColor='+bgcolor+'><layer id=tickernssub width='+scroller_width+' height='+scroller_height+' left=0 top=0>'+scrollercontent[0]+'</layer></ilayer>')
}
How to simply have it write "What's New?" and then immediately write the associated text (in this case a scrolling list) on the SAME line.

I've played with putting ("What's New?" '<ilayer id=........') but must be doing something wrong.

Thanks in advance.
Ent's Avatar
Ent Ent is offline Ent is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 3,237 posts.
 
Join Date: Apr 2009
Location: United Kingdom
Experience: Intermediate
07-Feb-2010, 08:45 AM #2
Have you tried ("What's New?" + '<ilayer id=........')?
trailerparkboy's Avatar
Member with 35 posts.
 
Join Date: Jun 2006
Experience: Intermediate
08-Feb-2010, 12:18 PM #3
Quote:
Have you tried ("What's New?" + '<ilayer id=........')?
Just tried that. For some reason, is still writing "What's New?" and then the scroller is appearing on below on separate line. Thought that should have worked.

I know for the following code, will put all on the same line...maybe I need to play with it a little more.

Code:
today =  "Today is " + days[now.getDay()] + ", " +
         months[now.getMonth()] + " " +
         date + ", " +
         (fourdigits(now.getYear())) ;

// Print out the data.
document.write(today);
Thanks.
Ent's Avatar
Ent Ent is offline Ent is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 3,237 posts.
 
Join Date: Apr 2009
Location: United Kingdom
Experience: Intermediate
09-Feb-2010, 10:52 AM #4
Try using CSS to set #tickernsmain to inline rather than block style.
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 10:34 PM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.