473,408 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Gah! Document.write is dead!

The1corrupted
134 100+
Alright, I'm embedding HTML, Javascript, and CSS all in PHP and right now, the javascript isn't functioning properly.
Expand|Select|Wrap|Line Numbers
  1. <script type='text/javascript'>
  2. var contents=\"\";
  3.     function dispcontent() {
  4.     var contents='1';
  5.     }
  6. </script>
  7. </head>
  8. <body class='leftstyle'>
  9. <u><font size='+1' style='font-weight:bold;'>Vardaes Manual</font></u>
  10. <br><br><br>
  11. <br><b>Navagation:</b><br>
  12. <table>
  13.     <tr>
  14.         <td>
  15.             <a href='home.php' target='maindisp' onmouseover='dispcontent()'>Manual Home</a>
  16.         </td>
  17.     </tr>
  18.     <tr>
  19.         <td>
  20.             <a href='help.php' target='maindisp'>Help Getting Started</a>
  21.         </td>
  22.     </tr>
  23.     <tr>
  24.         <td>
  25.             <a href='classes&races.php' target='maindisp'>Classes And Races</a>
  26.         </td>
  27.     </tr>
  28.     <tr>
  29.         <td>
  30.             <a href='rules.php' target='maindisp'>Rules of Vardaes</a>
  31.         </td>
  32.     </tr>
  33.     <tr>
  34.         <td>
  35.             <a href='origin.php' target='maindisp'>History of Vardaes</a>
  36.         </td>
  37.     </tr>
  38. </table>
  39. <hr>
  40. <script type='text/javascript'>
  41. while (contents=='1') {
  42.     document.write(\"Here it goes\");
  43.     }
  44. </script>
Basically, what I want to happen is (in the end) an onclick function that will call a table to the page without refresh. Right now, I'm using an onmousover to make things quicker. If I use a straight document.write to insert the table, the page dies. Like this code:
Expand|Select|Wrap|Line Numbers
  1.     function dispcontent() {
  2.     document.write(\"Blah\");
  3.     }
  4.  
If I try to make it a variable (like the above function), the page doesn't work. HELP!
Apr 6 '07 #1
1 1059
acoder
16,027 Expert Mod 8TB
Create a div or span:
[HTML]<div id="myDiv"></div>[/HTML] then set the innerHTML of that div instead of using document.write:
Expand|Select|Wrap|Line Numbers
  1. document.getElementById("myDiv").innerHTML='Blah!';
You can't use document.write after the page has loaded.
Apr 9 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Jova | last post by:
Is there a method or way for me to take a couple of char's and make a sting out of them . Example of what I want to do. String | char b = b ba = a bad = d
822
by: Turamnvia Suouriviaskimatta | last post by:
I 'm following various posting in "comp.lang.ada, comp.lang.c++ , comp.realtime, comp.software-eng" groups regarding selection of a programming language of C, C++ or Ada for safety critical...
26
by: Jannick | last post by:
Hi I have: unsigned int myvalue=0; unsigned char mytest=0; mytest=0x34; myvalue = mytest<<24; Then myvalue gets the value 0x1A000000!!!!! How is this possible? Should'nt it be 0x34000000???
11
by: S_at_work | last post by:
hello, can anybody give me a piece of code , or a hint , how i can recieve the time i need for connect() to another host in milliseconds. My problem is i want test the performance of...
99
by: Glen Herrmannsfeldt | last post by:
I was compiling a program written by someone else about six years ago, and widely distributed at the time. It also includes makefiles for many different systems, so I know it has been compiled...
62
by: Christopher Benson-Manica | last post by:
On thinking about the "replace a word in a file" thread, I wondered how easy it would be to accomplish the same thing with only one file pointer. This led me to some questions... "For a text...
143
by: suri | last post by:
Hello I downloaded glibc and tried looking for the code that implements the sine function i couldnt find the file. i went to the math directory and found math.h.. i guess that needs to be...
5
by: Mason | last post by:
I'm having some problems converting VBA for Word 2000 to code that VB.Net understands. I recorded a macro in Word to add numbering (a. b. c.) to my paragraphs. I managed to translate quite a bit...
2
by: Michael | last post by:
I cant seem to post a topic here, please email me if you can see this because i can't most probably. Here is the message i have been trying to post: I just wondered is there a reasonably easy...
6
by: MattWilson.6185 | last post by:
Hello! I am trying to convert a char * to a LPWSTR, and I am going absolutly mad! I can't find anything besides typle L"string" Unfortunetaly I can't use that... basicaly the setup is ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.