473,799 Members | 2,840 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Setting innerHTML

Hey,

I have a DIV and I want to dynamically set its innerHTML. I know I can
set it by doing the following myDiv.innerHTML = '<img
src=\"myImage.g if\">'
However, the html that I want to set in it is quite large so I dont
want to have to hard code the HTML like I just did.
My question is....is it possible to assign an existing html page to the
innerHTML.
e.g. myDiv.innerHTML = 'mytest.html'
So that the contents of the mytest.html would be set in myDiv's
innerHTML.

Thanks,

Chris

Jun 6 '06
22 2383
JRS: In article <bt************ *************** ***@comcast.com >, dated
Sat, 10 Jun 2006 19:04:53 remote, seen in news:comp.lang. javascript,
Randy Webb <Hi************ @aol.com> posted :
Dr John Stockton said the following on 6/10/2006 5:42 PM:
JRS: In article <Rq************ *************** ***@comcast.com >, dated
Sat, 10 Jun 2006 13:14:55 remote, seen in news:comp.lang. javascript,
Randy Webb <Hi************ @aol.com> posted :
tell him to read the newsgroup FAQ.
And nothing in that FAQ deals specifically with how to quote using
Google Groups so pointing a user to that FAQ doesn't help the problem
any at all.


You should read the newsgroup FAQ.

comp.lang.javas cript FAQ - 8.1 - 2005-11-05
Section 2.3, paragraph 7, which cites paragraph 6, refers.


I did, and the version at <URL: http://jibbering.com/faq/> that I get is :

comp.lang.java script FAQ - 8.0 - 2004-03-15

Which is obviously wrong but it is the same version that anybody else
would get unless a URL to a post of it in the archives is given instead.
I got tired of messing with Google Groups to try to find a URL to the
last FAQ Poster posted FAQ article. Does anybody have one?


You can see the HTML version, less CSS, HTML *possibly* edited a bit, at
<URL:http://www.merlyn.demo n.co.uk/$clj-faq.htm> but I don't intend to
keep a version there for more than a day or so. It's a copy of what I
saved for reference.

I would not have kept the last posted version; alas, I omitted to keep
the first posted one in my newsbase - it would have had a message-ID.
Its header should have included one of
Subject: comp.lang.javas cript FAQ - Quick Answers- 8.1 - 2005-11-05
Subject: comp.lang.javas cript FAQ - Quick Answers - 8.1 - 2005-11-05
which may help finding it.

A search for part of the paragraph of my previous article :-
<If posting through groups.google.c om don't use the "Reply" link at
the bottom of the article, instead use "Show Options" at the top of the
article and than click the "Reply" option exposed there. This
automatically includes the quote of the preceding message to be edited
down as described above.>
might work.

--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.c om/faq/> JL/RC: FAQ of news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jun 11 '06 #21
Dr John Stockton said the following on 6/11/2006 3:02 PM:
JRS: In article <bt************ *************** ***@comcast.com >, dated
Sat, 10 Jun 2006 19:04:53 remote, seen in news:comp.lang. javascript,
Randy Webb <Hi************ @aol.com> posted :
Dr John Stockton said the following on 6/10/2006 5:42 PM:
JRS: In article <Rq************ *************** ***@comcast.com >, dated
Sat, 10 Jun 2006 13:14:55 remote, seen in news:comp.lang. javascript,
Randy Webb <Hi************ @aol.com> posted :
> tell him to read the newsgroup FAQ.
And nothing in that FAQ deals specifically with how to quote using
Google Groups so pointing a user to that FAQ doesn't help the problem
any at all.
You should read the newsgroup FAQ.

comp.lang.javas cript FAQ - 8.1 - 2005-11-05
Section 2.3, paragraph 7, which cites paragraph 6, refers.

I did, and the version at <URL: http://jibbering.com/faq/> that I get is :

comp.lang.javas cript FAQ - 8.0 - 2004-03-15

Which is obviously wrong but it is the same version that anybody else
would get unless a URL to a post of it in the archives is given instead.
I got tired of messing with Google Groups to try to find a URL to the
last FAQ Poster posted FAQ article. Does anybody have one?


You can see the HTML version, less CSS, HTML *possibly* edited a bit, at
<URL:http://www.merlyn.demo n.co.uk/$clj-faq.htm> but I don't intend to
keep a version there for more than a day or so. It's a copy of what I
saved for reference.

I would not have kept the last posted version; alas, I omitted to keep
the first posted one in my newsbase - it would have had a message-ID.
Its header should have included one of
Subject: comp.lang.javas cript FAQ - Quick Answers- 8.1 - 2005-11-05
Subject: comp.lang.javas cript FAQ - Quick Answers - 8.1 - 2005-11-05
which may help finding it.


<URL:
http://groups.google.c om/group/comp.lang.javas cript/browse_frm/thread/801a5dd8beb8a7b 2/e3f59d54ce1e2a9 f?q=comp.lang.j avascript+FAQ+-+Quick+Answers+-+8.1+-+2005-11-05&rnum=1#e3f59 d54ce1e2a9f>

Yikes what a URL, but that is the newest one Google finds for it.
That is not the HTML version but it's better than the version found on
jibbering for me right now.

I put your HTML version - along with the CSS file - here:

<URL: http://members.aol.com/_ht_a/hikksnotathome/cljfaq/>

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Temporarily at: http://members.aol.com/_ht_a/hikksnotathome/cljfaq/
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 12 '06 #22
Dr John Stockton wrote:
JRS: In article <Rq************ *************** ***@comcast.com >, dated
Sat, 10 Jun 2006 13:14:55 remote, seen in news:comp.lang. javascript,
Randy Webb <Hi************ @aol.com> posted :
tell him to read the newsgroup FAQ.

And nothing in that FAQ deals specifically with how to quote using
Google Groups so pointing a user to that FAQ doesn't help the problem
any at all.

You should read the newsgroup FAQ.


As an alternative to the long and overwhelming newsgroup FAQ, I created the
"Newbie FAQ":
http://www.javascripttoolbox.com/clj/

This is my attempt to provide useful information (including a link to the
newsgroup FAQ) to newbie users who often make posting mistakes or aren't
familiar with the group.

For example, if someone replies incorrectly with google groups you can
simply direct them to:
http://www.javascripttoolbox.com/clj/#howtoreply

Or if someone posts a question and doesn't provide enough useful information
or a minimal test case, you can point them to:
http://www.javascripttoolbox.com/clj/#getanswers

etc. I'm not sure if people will find it useful or use it, but it exists :)

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Jun 12 '06 #23

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
47586
by: Kerri | last post by:
Hi, I have a span as below. <span id="lblTest" style="color:#FF0033;font- weight:bold;">This is a test.</span> When the user clicks a checkbox I call below code to set my span text to blank.
2
3569
by: Kerri | last post by:
Sorry, That was a typo. It should read. I have a RequiredFieldValidator This gets rendered out as a <span> I want to set the innerHTML.
7
4898
by: Harag | last post by:
Hi all I think this is in the wrong group but since I don't read others much or code in java script I was wondering if anyone could help me with this small problem, as I code mostly in ASP vbscript. I have the following piece of Javascript client code that displays the users clock on the browser and updates it every second.
5
21634
by: Soren Vejrum | last post by:
I am working on a web-based html editor using MSIE's designmode and iframes. Everything works just fine, but MSIE changes all my relative "a href" and "img src" links (i.e. "/index.asp") to absolute links (i.e. "http://localhost/index.asp") when I set the iframe's innerHTML. This is bad as the links are supposed to be relative. How can I avoid this? Any solutions/suggestions are much appreciated.
7
4870
by: Christopher J. Hahn | last post by:
I'm trying to use a script-generated form to submit to a script-generated iframe. The problem I'm running into is that the iframe is not assuming the name I assign it. IE6 on Win2000. FF1.0.2+ doesn't seem to have the problem. I'm doing: this.iframe = document.createElement( 'iframe' ); this.iframe.id = this.id + 'wh'; this.iframe.style.display = 'none';
10
1785
by: johndoe | last post by:
While creating a shopping cart application I noticed a strange bug which resulted in the Constructor and everything being called twice. I was using Inherited classes ClassShowProducts inherited TemplatePage which inherited System.Web.UI.Page which I thought was the problem so I spent all day recoding everything so that ClassShowProducts was inherited from System.Web.UI.Page. Then I found out that it still happend. I then quickly narrowed it...
5
1385
by: verrice | last post by:
Hello, I'm writing a web application where I want to load bits of data at runtime from the client end (via AJAX). The loading of the data part works great, but for some reason anytime I try to impart a style setting (via either putting it inline, a CSS, or through javascript) the DIV completely ignores my setting. The setting most importantly I'm trying to apply is display: none, but none of them work. If I pre-create everything...
1
2244
by: robbiedoo | last post by:
How can a value be set to a label in javascript. I can set values to <h6> tags, but I need to set the value of a label. Particularly becasue I can't seem to acces the value of an <h6> tag in the aspx.vb code-behind on the aspx page. So far I got the changing of <h6> values working by doing this: function SellLots_DoFSCommand(command, args){ if(args != "" && args != null) { ...
8
10112
Toxinhead
by: Toxinhead | last post by:
Hey there guys I am having a little trouble with InnerHTML as i can't seem to figure out how to set the style of my div tag..... What im trying to do is that when i rollover pic1 it changes that pic and displays:block and visiblity:visible....and also changes pic2.. When the webpage is loaded it displays:none and visivlity:hidden also Heres my code:
0
9541
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10482
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10027
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7564
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.