473,569 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

embedded html page

Hi,

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

<code>
<object id="page" data="table.htm l" 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 2303


Moist wrote:

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

<code>
<object id="page" data="table.htm l" 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="iframeNam e" src="table.html "></iframe>
that way you can in all browsers script
window.frames.i frameName.locat ion.reload();
Refreshing an <object> is difficult across browsers, recent Opera and
Netscape/Mozilla version allow you to access the contentDocument
property of the HTMLObjectEleme nt element object and then you can access
the defaultView and from there the location object:

<object id="object1"
type="text/html"
data="test20040 90402.html">
width="200" height="200"></object>
<input type="button" value="refresh"
onclick="var object = document.getEle mentById('objec t1');
if (object.content Document &&
object.contentD ocument.default View &&
object.contentD ocument.default View.location) {
object.contentD ocument.default View.location.r eload();
}">
--

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

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


Moist wrote:

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

<code>
<object id="page" data="table.htm l" 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="iframeNam e" src="table.html "></iframe>
that way you can in all browsers script
window.frames.i frameName.locat ion.reload();
Refreshing an <object> is difficult across browsers, recent Opera and
Netscape/Mozilla version allow you to access the contentDocument property
of the HTMLObjectEleme nt element object and then you can access the
defaultView and from there the location object:

<object id="object1"
type="text/html"
data="test20040 90402.html">
width="200" height="200"></object>
<input type="button" value="refresh"
onclick="var object = document.getEle mentById('objec t1');
if (object.content Document &&
object.contentD ocument.default View &&
object.contentD ocument.default View.location) {
object.contentD ocument.default View.location.r eload();
}">


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*******@yaho o.de> a écrit dans le message de news:
41************* **********@news read4.arcor-online.net...

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

<code>
<object id="page" data="table.htm l" 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.getEl ementById) {
page = document.getEle mentById('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.htm l" 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.getEl ementById) {
page = document.getEle mentById('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.getEle mentById('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.vid eotron.net...
>I have an embedded HTML object as follows (ignore the code tag):
>
><code>
> <object id="page" data="table.htm l" 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.getEl ementById) {
page = document.getEle mentById('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.getEle mentById('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
3548
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 to me. I recently created a BBS (Bulletin Board Service) on my website where I allow people to post messages via a form. It just occurred to me that...
2
1563
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 Opera both complain about my use of &var=value pairs in the generated URL. Below is my code that generates the string, and is part of an embedded...
0
1626
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 id=objTest
2
7360
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 ( but this doesn't work ): WebBrowser.Navigate( "MyApplication.Sample.html" ) Does anyone know if
2
8159
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() { var a = document.getElementById("obj1"); var obj = document.createElement("object"); obj.data = "dayenu.mid";
1
2565
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. Please no flames; I'm not a FP fan either but that's the only tool I'm given, and the templates coupled with css made it easy for me (and others) to...
2
2407
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 namespace "EmbeddedResources" My resources are not included when the content is rendered in the browser. I have marked my JavaScript resource as...
6
6475
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 src="person.gif"> person.gif is an image that is located in my bin folder.
1
3028
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 receives as HTML and uses JEditorPane to render the HTML. The overall architecture is like I have a HTML request processor thread which connects to...
0
7618
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...
0
7926
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. ...
1
7679
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
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...
0
6287
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
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...
0
3657
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...
0
3647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
946
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...

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.