?
Solved

Back to "preloading" html again...

Posted on 2003-03-28
6
Medium Priority
?
253 Views
Last Modified: 2013-12-16
After a quick search of the net for preloading text on a page, I came across this topic: http://www.experts-exchange.com/Web/Web_Languages/HTML/Q_20499229.html

I am currently in a small team designing a webpage for a school camp. We are having difficulties in working out the coding to make a script that writes text on our page when a menu image is clicked.  Our page uses divisions instead of frames, and if possible we would like to keep it this way.  Basically, I am looking for how to make this htmlgoodies script:

<SCRIPT LANGUAGE="JavaScript">
function openindex()
      {
OpenWindow=window.open("", "newwin");
OpenWindow.document.write("<HTML>")
OpenWindow.document.write("<TITLE>Title Goes Here</TITLE>")
OpenWindow.document.write("<BODY BGCOLOR=pink>")
OpenWindow.document.write("<h1>Hello!</h1>")
OpenWindow.document.write("This text will appear in the window!")
OpenWindow.document.write("</BODY>")
OpenWindow.document.write("</HTML>")
     }
</SCRIPT>

create a new division/layer as opposed to a new window.  I suppose this is more of a javascript topic, but the script is there, we're just not sure how to make it open a new division (with text/code) instead of a window.  Htmlgoodies.com states they have seen this done, but unfortunately does not supply the code.  Considering the last person to ask this seemed happy with that code, does anyone here know how we could do this?  Obviously it is possible.

It also does away with loading times and will make the site look more professional.

Thank you in advance.
0
Comment
Question by:inferno_x
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 17

Accepted Solution

by:
dorward earned 300 total points
ID: 8225398
0
 
LVL 5

Expert Comment

by:russellshome
ID: 8229057
A little demo:

<script>
function getObject(id) {
     if (document.all) {
          return document.all(id);
     } else if (document.getElementById) {
          return document.getElementById(id);
     }
     return null;
}

function openindex() {
     var html = "<div style='background-color:pink'>"
     html += "<h1>Hello!</h1>"
     html += "This text will appear in the div!"
     html += "</div>"
     return html;
}

var innerHTML;

function doTest(objButton,id) {
     if (objButton.value=="Show") {
          innerHTML = getObject(id).innerHTML;
          getObject(id).innerHTML=openindex();
          objButton.value="Hide";    
     } else {
          getObject(id).innerHTML = innerHTML;
          objButton.value="Show";    
     }
}
</script>

<table>
     <tr>
          <td id="test1" style="width:200px;height:100px;" valign="top">Change This Text</td>
          <td id="test2" style="width:200px;height:100px;" valign="top">No Change to This Text</td>
     </tr>
</table>

<p>

<form>
     <input type="button" value="Show" onClick="doTest(this,'test1');" style="width:100px">
</form>
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 8820621
This question has been classified abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.

<note>
Unless it is clear to me that the question has been answered I will recommend delete.  It is possible that a Grade less than A will be given if no expert makes a case for an A grade. It is assumed that any participant not responding to this request is no longer interested in its final disposition.
</note>

If the user does not know how to close the question, the options are here:
http://www.experts-exchange.com/help/closing.jsp


Cd&

0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 17

Expert Comment

by:dorward
ID: 8821623
recommendation: Points to me for pointing to a detailed and easy to follow tutorial (well, I found it easy to follow and JavaScript and I have never gotten on well).
0
 
LVL 5

Expert Comment

by:russellshome
ID: 8859382
Recommendation: Points to me for giving an excellent and easy to follow demo.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 9016113
It is time to clean this abandoned question up.

I am putting it on a clean up list for CS.

<recommendation>
points to dorward

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question