Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old October 11th, 2008, 06:15 AM
Joe D Williams
Guest
 
Posts: n/a
Default updating data in object


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


  #2  
Old October 11th, 2008, 11:05 AM
Thomas 'PointedEars' Lahn
Guest
 
Posts: n/a
Default Re: updating data in object

Joe D Williams wrote:
Quote:
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.
Quote:
</object>
>
And a link with onclick:
>
<a href="../CFR/next.htm" class='button2'
onclick="first();return false;"
onclick="first(this.href); return false;"
Quote:
then a script:
>
function first() {
function first(s)
{
Quote:
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().
Quote:
}
>
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.
Quote:
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
  #3  
Old October 11th, 2008, 12:05 PM
Conrad Lender
Guest
 
Posts: n/a
Default Re: updating data in object

On 2008-10-11 11:55, Thomas 'PointedEars' Lahn wrote:
Quote:
Quote:
>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
  #4  
Old October 11th, 2008, 01:25 PM
Thomas 'PointedEars' Lahn
Guest
 
Posts: n/a
Default Re: updating data in object

Conrad Lender wrote:
Quote:
On 2008-10-11 11:55, Thomas 'PointedEars' Lahn wrote:
Quote:
Quote:
>>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.
Quote:
[...]
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
  #5  
Old October 11th, 2008, 11:05 PM
Joe D Williams
Guest
 
Posts: n/a
Default Re: updating data in object

Quote:
Quote:
>>"Thomas 'PointedEars' Lahn" <PointedEars@web.dewrote in message
>>news:48F077F5.9070008@PointedEars.de...
Quote:
>>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.
>>
Quote:
>></object>
>>>
>>And a link with onclick:
>>>
>><a href="../CFR/next.htm" class='button2'
>>onclick="first();return false;"
>>
> onclick="first(this.href); return false;"
>>
Quote:
>>then a script:
>>>
>>function first() {
>>
> function first(s)
Quote:
>> {
>>>
>>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().
>>
Quote:
>>}
Thanks for that this. I knew I was putting the full url in href for a good
reason.
Quote:
Quote:
Quote:
>>>
>>Why does this only work, where works is when the new html replaces the
>>old
>>html, in Firefox?
Quote:
Quote:
>You must be doing something else wrong.
>>
Quote:
>>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.
Quote:
>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)
Quote:
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


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles