Write on <OBJECT type="text/html"> ?

A

Arash Dejkam

Hi All,

Is it possible to write on an <OBJECT type="text/html"> using
document.write() from within the html containing that tag the way we write
on a popup window? I couldn't do that after a lot of try.

Thanks in advance.
 
W

Will Gittoes

Arash said:
Hi All,

Is it possible to write on an <OBJECT type="text/html"> using
document.write() from within the html containing that tag the way we write
on a popup window? I couldn't do that after a lot of try.

Thanks in advance.

Remember, you can use single quotes as well.

document.write("<OBJECT type='text/html'>")
| |
Single quotes----------------+---------+

Don't cross-post, please.
 
R

Rob Collyer

Yes it is possible to output any type of mark-up at run-time using document.write.
 
S

SpaceGirl

Will said:
Remember, you can use single quotes as well.

document.write("<OBJECT type='text/html'>")
| |
Single quotes----------------+---------+

Don't cross-post, please.

or

document.write("<OBJECT type=\"text/html\">")
| |
forces the character following to be ignored



--


x theSpaceGirl (miranda)

# lead designer @ http://www.dhnewmedia.com #
# remove NO SPAM to email, or use form on website #
 
R

Rob Collyer

You didn't get the point.
I don't want to write on my html but on the object frame itself,
something like this:

<object id="foo" type="text/html" />
<script>
foo.document.write("Hello World!");
</script>

What exactly are you trying to achieve?

There must be a better way, than the way you are approching this.
 
R

rf

[massive crosspost trimmed

SpaceGirl wrote
Will Gittoes wrote:

or

document.write("<OBJECT type=\"text/html\">")
| |
forces the character following to be ignored

I'm confused.

What does document.write have to do with cross posting?
 
A

Arash Dejkam

Will Gittoes said:
Remember, you can use single quotes as well.

document.write("<OBJECT type='text/html'>")
| |
Single quotes----------------+---------+

Don't cross-post, please.

You didn't get the point.
I don't want to write on my html but on the object frame itself, something
like this:

<object id="foo" type="text/html" />
<script>
foo.document.write("Hello World!");
</script>
 
R

Rob Collyer

Rob, I want to write on the OBJECT frame but want the script to be on
the html page containing that OBJECT.

I'm not entirely sure this is possible....
an object usually exposes properties and methods which you can get to
with javascript...

As you are using text/html and not specifying a class id for the object,
it is essentially a blank object.... and I dont know that you will be
able to do anything with it.

Experiment and report back here if you find out how, although I have to
say this seems totally unneeded.... why not just use a DIV?

What exactly are you trying to achieve?
 
M

Matthias Gutfeldt

Arash said:
well check this page: http://portfolio.dejkam.com
use the form and see what it does.
it copies the form to a new window using document.write() and submits that
form.
I initially liked the new window to be invisible but browsers doesn't allow
that so I went on using an IFRAME with 1x1 size, but then again the page
should be valid XHTML1.0 Strict and that doesn't
allow IFRAME, so I tried to use OBJECT type="text/html" but I couldn't write
on that.

Why on earth are you doing this?? If you want the user to return to the
start page after form submission, just use the location header in
PHP:<http://www.php.net/header>. That's easier, more reliable, and less
confusing for the visitor.


Matthias
 
A

Arash Dejkam

Rob Collyer said:
Yes it is possible to output any type of mark-up at run-time using document.write.

--

Rob, I want to write on the OBJECT frame but want the script to be on the
html page containing that OBJECT.
 
R

Rob Collyer

well check this page: http://portfolio.dejkam.com
use the form and see what it does.
it copies the form to a new window using document.write() and
submits that form.
I initially liked the new window to be invisible but browsers doesn't
allow that so I went on using an IFRAME with 1x1 size, but then again
the page should be valid XHTML1.0 Strict and that doesn't
allow IFRAME, so I tried to use OBJECT type="text/html" but I couldn't
write on that.

Thanks,

why do you need it copied to a duplicate form?
 
R

rf

Because it is cleaner and faster Matthias, it is also quite reliable,

No, it is not reliable at all. It breaks for me, as you will see below.
for
browsers with scripts disabled

I don't have scripts[sic] disabled but I also to not allow a web page to
spawn a new window, for any reason, unless *I* allow or request this to
happen.
I have a normal submit button within a
<noscript></noscript> tag. even if a dumb pop-up blocker block my window the
script will detect that and will submit the form in normal way.

No, arash, your script will not detect this. As far as your script is
concerned the window *did* open, because, as far as your script is concerned
it *did* open. The return code from whatever javascript you used to open the
new window returned the fact that the new window *did* open.

However, my popup blocker detects new windows opening and immediately closes
them, before they have a chance to to anything at all. In fact, my popup
blocker stops the popup window from being created *as* it is created, but in
a way that is not reported back to your "script". Your script does not
realize this. It does not know, it thinks the window.open actually worked,
but it did not.

Total failure.

You will see (in whatever you store this stuff from your form in) exactly
one entry from me, the one with an x in all of the fields. I actually ran
the form twice but only on the second occasion did I allow the popup.

I think you have a broken form here.

I think you have a broken web page.
 
A

Arash Dejkam

What exactly are you trying to achieve?

There must be a better way, than the way you are approching this.

well check this page: http://portfolio.dejkam.com
use the form and see what it does.
it copies the form to a new window using document.write() and submits that
form.
I initially liked the new window to be invisible but browsers doesn't allow
that so I went on using an IFRAME with 1x1 size, but then again the page
should be valid XHTML1.0 Strict and that doesn't
allow IFRAME, so I tried to use OBJECT type="text/html" but I couldn't write
on that.

Thanks,
 
A

Arash Dejkam

Why on earth are you doing this?? If you want the user to return to the
start page after form submission, just use the location header in
PHP:<http://www.php.net/header>. That's easier, more reliable, and less
confusing for the visitor.


Matthias

Because it is cleaner and faster Matthias, it is also quite reliable, for
browsers with scripts disabled I have a normal submit button within a
<noscript></noscript> tag. even if a dumb pop-up blocker block my window the
script will detect that and will submit the form in normal way.

Arash
 
R

rf

Arash said:
But thanks anyway, I didn't know some pop-up blockers terminate the window
just after they've been created, I have to find a work around for that.

You won't. That is what popup blockers are for. To stop popups. Do you
really think that *you* can find a way around a popup blocker that has not
been thought of many times before, by the very people who write those popup
blockers.
 
R

rf

Arash said:
Well, I think you are wrong, not every new window is bad. pop-up blockers
must distinguish between good and bad. when you open a window and another
window opens automatically without your permission that's bad, but when you
click on something that opens a pop-up you are implicitly giving permission
for that. most pop-up blockers (incuding my google toolbar) understand this
and allow pop-ups that don't open automatically like what I used on my page.
other blockers that don't understand this, I call them dumb blockers and
never use them.

As you wish.

My popup blocker allows me to *allow* popups if I wish. I have to use a
keyboard guesture to make this happen. If you think this is dumb then more
fool you.

Some browsers *allow* similar things to happen but do *not* display the
page in a new browser instance. Some of them use the existing window. Some
of them open a new pane.

In any case why do *you* think that *I* want a new window opened. If I did
then *I* can quite easily do this myself. By choosing to "force" me to open
a new window you have effectivly removed from my browsing experience one of
my choices, to your detriment.
 
A

Arash Dejkam

Oh come on... Bad design. Bad knowledge of how a server works. Bad design.

Hi Richard!

I think you dropped something at the end of your message "...bad design you
mother*$%^$#$$# *#$hole" :)) kidding, I mean just calm down! I asked a
question didn't request for critique and just because I can't shout like you
doesn't mean I don't know how servers work, I've been in this bussiness for
about 8 years now, I think I know a little about these stuff.
But thanks anyway, I didn't know some pop-up blockers terminate the window
just after they've been created, I have to find a work around for that.

Thanks,
Arash
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top