473,395 Members | 2,222 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,395 software developers and data experts.

embedded html page

Hi,

I have an embedded HTML object as follows (ignore the code tag):

<code>
<object id="page" data="table.html" type="text/html" .... >
</code>

I look for the Javascript code (placed in the main document) that can reload
or refresh the object contains at will?

Thanks for any idea!
Moist


Jul 23 '05 #1
6 2293


Moist wrote:

I have an embedded HTML object as follows (ignore the code tag):

<code>
<object id="page" data="table.html" type="text/html" .... >
</code>

I look for the Javascript code (placed in the main document) that can reload
or refresh the object contains at will?


Consider using an iframe e.g.
<iframe name="iframeName" src="table.html"></iframe>
that way you can in all browsers script
window.frames.iframeName.location.reload();
Refreshing an <object> is difficult across browsers, recent Opera and
Netscape/Mozilla version allow you to access the contentDocument
property of the HTMLObjectElement element object and then you can access
the defaultView and from there the location object:

<object id="object1"
type="text/html"
data="test2004090402.html">
width="200" height="200"></object>
<input type="button" value="refresh"
onclick="var object = document.getElementById('object1');
if (object.contentDocument &&
object.contentDocument.defaultView &&
object.contentDocument.defaultView.location) {
object.contentDocument.defaultView.location.reload ();
}">
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2

"Martin Honnen" <ma*******@yahoo.de> a écrit dans le message de news:
41***********************@newsread4.arcor-online.net...


Moist wrote:

I have an embedded HTML object as follows (ignore the code tag):

<code>
<object id="page" data="table.html" type="text/html" .... >
</code>

I look for the Javascript code (placed in the main document) that can
reload or refresh the object contains at will?
Consider using an iframe e.g.
<iframe name="iframeName" src="table.html"></iframe>
that way you can in all browsers script
window.frames.iframeName.location.reload();
Refreshing an <object> is difficult across browsers, recent Opera and
Netscape/Mozilla version allow you to access the contentDocument property
of the HTMLObjectElement element object and then you can access the
defaultView and from there the location object:

<object id="object1"
type="text/html"
data="test2004090402.html">
width="200" height="200"></object>
<input type="button" value="refresh"
onclick="var object = document.getElementById('object1');
if (object.contentDocument &&
object.contentDocument.defaultView &&
object.contentDocument.defaultView.location) {
object.contentDocument.defaultView.location.reload ();
}">


Thanks for this info!
Frames is probably the simplest solution. But do you know if IE can access
embedded objects in a HTML page, or at least reload them. I've searched in
MSDN library with no success so far, I didn't see any methods that can do
that. May there is none... :(


Martin Honnen
http://JavaScript.FAQTs.com/

Jul 23 '05 #3


Moist wrote:
"Martin Honnen" <ma*******@yahoo.de> a écrit dans le message de news:
41***********************@newsread4.arcor-online.net...

Moist wrote:
I have an embedded HTML object as follows (ignore the code tag):

<code>
<object id="page" data="table.html" type="text/html" .... >
</code>
But do you know if IE can access
embedded objects in a HTML page, or at least reload them.


IE can access the object elemens the same way as other elements, e.g.
var page;
if (document.getElementById) {
page = document.getElementById('page');
alert(page.data);
}
but in my tests it refuses to change the loaded data if you reassign to
the data property.
I haven't found a way to access the document inside of an embedded
<object> element with IE.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #4
>>>>I have an embedded HTML object as follows (ignore the code tag):

<code>
<object id="page" data="table.html" type="text/html" .... >
</code>
But do you know if IE can access embedded objects in a HTML page, or at
least reload them.


IE can access the object elemens the same way as other elements, e.g.
var page;
if (document.getElementById) {
page = document.getElementById('page');
alert(page.data);
}
but in my tests it refuses to change the loaded data if you reassign to
the data property.
I haven't found a way to access the document inside of an embedded
<object> element with IE.


Using your code and trying 'location.href' instead, it seems to work:

object = document.getElementById('table');
object.location.href = "c:\\table.html";

It reloads the page I wanted to. However, as you said, accessing elements in
that page remains to be seen...

Moist
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 23 '05 #5

"Moist" <a@b.com> a écrit dans le message de news:
iz******************@weber.videotron.net...
>I have an embedded HTML object as follows (ignore the code tag):
>
><code>
> <object id="page" data="table.html" type="text/html" .... >
></code>
>
But do you know if IE can access embedded objects in a HTML page, or at
least reload them.


IE can access the object elemens the same way as other elements, e.g.
var page;
if (document.getElementById) {
page = document.getElementById('page');
alert(page.data);
}
but in my tests it refuses to change the loaded data if you reassign to
the data property.
I haven't found a way to access the document inside of an embedded
<object> element with IE.


Using your code and trying 'location.href' instead, it seems to work:

object = document.getElementById('table');
object.location.href = "c:\\table.html";

It reloads the page I wanted to. However, as you said, accessing elements
in that page remains to be seen...

Moist


I discovered even simpler, just by using the name of the object directly:

table.location.href = "c:\\table.html";

Moist
--

Martin Honnen
http://JavaScript.FAQTs.com/


Jul 23 '05 #6
On Sun, 5 Sep 2004 13:01:28 -0400, Moist <a@b.com> wrote:

[snip]

Please trim quoted text that doesn't apply to your post.
I discovered even simpler, just by using the name of the object directly:

table.location.href = "c:\\table.html";


It will work in IE, but it is unlikely to work in other browsers. See:

<URL:http://jibbering.com/faq/#FAQ4_41>

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #7

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

Similar topics

2
by: Aquarius2431 | last post by:
Hi!, I don't think I have posted to this group before. Have been using PHP on my webserver for a few months now and finding that I like it quite a bit. Here is a question that just occurred...
2
by: Rick | last post by:
Hi.. I've got some code I wrote in PHP that will generate an HTML page with embedded javascript which in turn creates a new argument string for the browser, but the xhtml parser in Firefox and...
0
by: ATS | last post by:
HOWTO Make a UserControl deploy an embedded resource. Please help, I need to embed an EXE into a C# UserControl that is run from script in an HTML web page as such: <html> <object...
2
by: FishingScout | last post by:
I have a small html file that I have added to my project. When I added "sample.html", I set the build action to "embedded resource". In the application I would like to do something like this (...
2
by: Owen.Leibman | last post by:
Here is a complete web page: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> <html> <head> <title>Javascript Embed and onunload</title> <script type="text/javascript"> function useplayer() {...
1
by: jmc | last post by:
The short version: Is there a way to get embedded styles to work on files that are displayed in a page using the shtml Include method? My work intranet site uses Front Page dynamic templates. ...
2
Frinavale
by: Frinavale | last post by:
I am attempting to use embedded resources in an Ajax Enabled ASP.NET Web Application. I'm using Visual Studio 2008 and VB.NET server side code. The project is called "EmbeddedResources" with the...
6
by: LEM | last post by:
Hi, I use a Webbrowser component to display a page that has been generate dynamically from my C# program. This page contains some images that are displayed using HTML code like this: <img...
1
by: humtum | last post by:
Greetings Everyone! I am working on a Java application where I have to develop a Swings client which talks to a web-server. The client sends the HTTP get request for a specific resource which it...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.