473,386 Members | 1,598 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,386 software developers and data experts.

div content doesn't fit text is wider than the specified area of div

I make a webpage which reads text from file and display it into a div
the problem is that div content is wider than the div itself I have tried many codes but it works only if the content is pre-inserted into div

the code i wrote in javascript is this

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript" language="javascript">
  2.     srcFrame;
  3.     //External content into a layer
  4.     function loadOuter(doc) {
  5.     srcFrame = document.getElementById("hiddenContent");
  6.     srcFrame.src = doc;
  7.     // workaround for missing onLoad event in IFRAME for NN6
  8.     if (!srcFrame.onload) {
  9.     setTimeout("transferHTML()", 1000)
  10.     }
  11.     }
  12.  
  13.     function transferHTML()
  14.     {
  15.         srcContent='';
  16.         if (srcFrame.contentDocument)
  17.         {
  18.           srcContent=srcFrame.contentDocument.getElementsByTagName("BODY")[0].innerHTML;
  19.         }
  20.         else if (srcFrame.contentWindow)
  21.         {
  22.             srcContent=srcFrame.contentWindow.document.body.innerHTML;
  23.         }
  24.         document.getElementById("Day").innerHTML =srcContent;
  25.  
  26.     }
  27.     </script>
Jan 26 '13 #1
0 1454

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

Similar topics

1
by: Dennis C. Drumm | last post by:
How can I determine if a string will fit in the display area of a text box? I don't want to use a char count because the width of each char can vary. I suspect I need to convert the string to a...
1
by: Alex Smith | last post by:
Hi Friends, I want to open and read a pdf file from disk And save this content of pdf file into .txt file. In short I want to convert content of pdf into .txt formate and save this text file on...
0
by: Sriram | last post by:
I have created a web service using C#. This basically receives a string as a parameter and returns an XML string. There is a specific requirment that the users should be able to call this web...
1
by: Sebastian Araya | last post by:
Hello, I'm running PHP 5.2 on gentoo distribution. I'm testing SOAP new extensions, but I'm facing a strange problem... I built a little class and used setClass() and handle() to make PHP handle...
5
by: tarscher | last post by:
Hi all, I create a set of text-boxes based on user input: for (int i = 0; i < Convert.ToInt16(keywordsDropDownList.Text); i++) { myTextBox = new TextBox(); myTextBox.Columns = 5;...
2
by: whisher | last post by:
Hi. I'm taking my first steps with xml and SimpleXML functions. xml.php (It could be made dynamically with a mysql result I post this snippet for example ) PHP Code xml.php: <?php $xmlstr...
1
by: Anita Singh2310 | last post by:
I have 1 JSP page,which is containing 1 button & 1 TextArea. I want that when i click the button, the content of textArea will copy into Word Document. Can anyone please help me?
4
by: daithi | last post by:
Hi This is probably simple but I cant find it on the net. I want to highlight the text in a text area when the user clicks the area. I presume its onclick = something. But I dont know what. Can...
3
by: K Viltersten | last post by:
I've been informed that a webserver sending a XML file is supposed to add "Content-Type: text/xml header". I'm not questioning that infromation but i'm unsure what was ment by it. The XML i get...
3
by: madankarmukta | last post by:
Hi, Objectives is to write the DataTable content to the text file in the format Col1 | Col2 | Col3 ------|-------|--------- Val11 | Val21 | Val31 Val12 | Val22 | Val32 Val13 | Val23 |...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.