Select Categories Below
Advertisement
Start Your Own Q&A Site
Create your own Q&A site easily, allowing you to quickly grow a new community around any subject matter or generate new organic traffic for your existing website.
Status: Closed Points: 100 Time: 07:15 - Dec 29, 2006
mary2
I am creating protoypes in HTML and CSS and I wanted to see if there was an easier way to have the same thing show up over and over again. Is there any way to have include files in JavaScript that would contain HTML tables, cells, CSS, etc?
Categories:
Add Categories
When adding more than one category, separate them with commas.
xarcus
Date:: Dec 29, 2006
Time:: 11:10
If you are speaking of HTML includes there is the old "Server side includes" directive <!--#include file="header.html" --> that works with Apache as well as MS IIS. For Apache servers you should use the .shtml extension Apache SSI: http://httpd.apache.org/docs/1.3/howto/s... MS IIS SSI: http://www.microsoft.com/WINDOWS2000/en/...
Time:: 11:36
Is there anything that will just work on my PC on the client side?
Time:: 17:23
For client side: --start of script.js-- function gen_table_at_id( my_id) { var mydiv = document.getElementById( my_id) ; mydiv.innerHTML = "<table><tbody><tr>" +"<td>Cell1</td>" +"<td>Cell2</td>" +"</tr></tbody></table>" ; } --end of script.js-- <html> <head> <title>Test</title> <script type="text/javascript" src="script.js"></script> </head> <body onload="gen_table_at_id('mydiv')"> <div id="mydiv"> </div> </body> </html>
Date:: Jan 02, 2007
Time:: 06:22
xarcus, not sure who you are, but you're the man. That works great and saves me a ton of time for these prototypes. One more follow up question. On the html page where it says: <body onload="gen_table_at_id('mydiv')"> Is there any way to load multiple functions at the same time from the same script.js file? I want to put all of my includes in one file and wanted to see how I would load more than one of them in the body tag.
Time:: 06:33
Nevermind, I just found out what the answer is. To load more than one function, you just need to insert a semicolon ";" between functions on the onload command Example: <body onload="gen_table_at_id('mydiv'); gen_secondfunction('secondfunction')"> Thanks for the help.
Question Answered
This question has been closed, and points have been rewarded to the following experts:
You're welcome however to comment or give additional information or if you wish, you have the ability to write a Tutorial in the Tutorial Area.
Answer this Question
New User
Email:
Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address
Registered User
Username:
Password:
Forgot Your Password?
Enter your email address below and we will resend your login information to you.
Login Information Sent
Questions
whats the best food to eat during midnight?
How to identify the tiffany jewelry? www.tffanycheapmall.com.
Send an email alert to each user of the php application based on criteria
How I Increased My AdSense Earnings?
how to choose the lady dress ?
How can I fulfill the minimum requirement to make your computer support 3D?
You have 100 characters to use
Rank
Expert
Points
1.
10354
2.
6493
3.
5596
4.
4848
5.
3487
6.
2840
7.
2770
8.
2303
9.
1820
10.
917
Register today to share your knowledge with the community and be recognized and rewarded for your contributions.
Register Here
"Psst, Quomon is a great site. Pass it on." Tell a Friend | Link To Us | Save to Delicious | Digg it
Language Options
English:
Español:
Sponsors
Questions and Answers Software