By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,848 Members | 3,202 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,848 IT Pros & Developers. It's quick & easy.

updating data in object

P: n/a

Hi,

First I have an object element:

<object id='mC' class='content2'
data='index.htm' type='text/html' style=''>
</object>

And a link with onclick:

<a href="../CFR/next.htm" class='button2'
onclick="first();return false;"

then a script:

function first() {
document.getElementById("mC").data="../CFR/next.htm";
}

Why does this only work, where works is when the new html replaces the old
html, in Firefox?

If i cut the return false IE and Safari replace the entire page.

Thank You and Best Regards,
Joe
Oct 11 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Joe D Williams wrote:
First I have an object element:

<object id='mC' class='content2'
data='index.htm' type='text/html' style=''>
The `style' attribute value MUST NOT be empty. Remove the attribute
specification or specify a value that complies with the standard.
</object>

And a link with onclick:

<a href="../CFR/next.htm" class='button2'
onclick="first();return false;"
onclick="first(this.href); return false;"
then a script:

function first() {
function first(s)
{
document.getElementById("mC").data="../CFR/next.htm";
document.getElementById("mC").data = s;

is easier to maintain. You might also want to do a feature test with
fallback on document.getElementById().
}

Why does this only work, where works is when the new html replaces the old
html, in Firefox?
Switching from "http://localhost/" to "http://www.google.com/" on
"http://www.w3.org/" (dynamically created) *WFM* in "Mozilla/5.0 (Windows;
U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3".

You must be doing something else wrong.
If i cut the return false IE and Safari replace the entire page.
Gecko-based UAs do that, too. Works as designed, since the default action
for the hyperlink was not prevented.
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Oct 11 '08 #2

P: n/a
On 2008-10-11 11:55, Thomas 'PointedEars' Lahn wrote:
>Why does this only work, where works is when the new html replaces
the old html, in Firefox?

Switching from "http://localhost/" to "http://www.google.com/" on
"http://www.w3.org/" (dynamically created) *WFM* in "Mozilla/5.0
(Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417
Firefox/3.0.3".

You must be doing something else wrong.
That's what he wrote, it was working in Firefox, but not Safari or IE.

Changing .data on that <objectdoesn't appear to be well supported at
all in current browsers:

Firefox 2.0.0.15/Linux no
Firefox 3.0.3/WinXP yes
Safari 3.1/WinXP yes
Opera 9.5/Linux yes
Internet Explorer 6/WinXP no (and issues 2 warnings)
Internet Explorer 7/WinXP no (doesn't load external data at all)

Looks like it would be simpler to just use an Iframe.
- Conrad
Oct 11 '08 #3

P: n/a
Conrad Lender wrote:
On 2008-10-11 11:55, Thomas 'PointedEars' Lahn wrote:
>>Why does this only work, where works is when the new html replaces
the old html, in Firefox?
Switching from "http://localhost/" to "http://www.google.com/" on
"http://www.w3.org/" (dynamically created) *WFM* in "Mozilla/5.0
(Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417
Firefox/3.0.3".

You must be doing something else wrong.

That's what he wrote, it was working in Firefox, but not Safari or IE.
ACK, my bad. A bit complicated wording, though.
[...]
Looks like it would be simpler to just use an Iframe.
Full ACK.
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Oct 11 '08 #4

P: n/a
>>"Thomas 'PointedEars' Lahn" <Po*********@web.dewrote in message
news:48**************@PointedEars.de...
>>Joe D Williams wrote:
First I have an object element:

<object id='mC' class='content2'
data='index.htm' type='text/html' style=''>

The `style' attribute value MUST NOT be empty. Remove the attribute
specification or specify a value that complies with the standard.
>></object>

And a link with onclick:

<a href="../CFR/next.htm" class='button2'
onclick="first();return false;"

onclick="first(this.href); return false;"
>>then a script:

function first() {

function first(s)
>> {

document.getElementById("mC").data="../CFR/next.htm";

document.getElementById("mC").data = s;

is easier to maintain. You might also want to do a feature test with
fallback on document.getElementById().
>>}
Thanks for that this. I knew I was putting the full url in href for a good
reason.
>>>
Why does this only work, where works is when the new html replaces the
old
html, in Firefox?
>You must be doing something else wrong.
>>If i cut the return false IE and Safari replace the entire page.

Gecko-based UAs do that, too. Works as designed, since the default
action
for the hyperlink was not prevented.
>Conrad Lender wrote
Changing .data on that <objectdoesn't appear to be well supported at
all in current browsers:
Firefox 2.0.0.15/Linux no
Firefox 3.0.3/WinXP yes
Safari 3.1/WinXP yes
Opera 9.5/Linux yes
Internet Explorer 6/WinXP no (and issues 2 warnings)
Internet Explorer 7/WinXP no (doesn't load external data at all)
Looks like it would be simpler to just use an Iframe.
Add IE8 to the no work list.

I did not expect a failure using object here. I was looking for a param to
use for the target url.

I am back in the land of iframes.

Thanks Again and Best Regards,
Joe
Oct 11 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.