problem with <object></object>

For all coding issues - MODers and programmers, HTML and more.

Moderators: Jeff250, fliptw

Post Reply
User avatar
Isaac
DBB Artist
DBB Artist
Posts: 7740
Joined: Mon Aug 01, 2005 8:47 am
Location: 🍕

problem with <object></object>

Post by Isaac »

I'm writing a very easy to use comment box for my friend's site. It should allow my friend to make as many comment boxes as he wants by pasting a little html into the body of his html.

A cool feature: To make a new comment box he just has to change a little text, "commentbox1", to a different name and the cgi file figures everything out on its own.

I have an example running:
[link removed]

It seems that the <object> tag does not always work in Internet Explorer.
Currently I'm trying to make a comment box system that requires very little user-side code.

This is how the comments are displayed. The "?boxname=commentbox1" is how the cgi file knows what dictionary key to reference. This way the same cgi file and database text file can be used for all the comment boxes on a website.

Code: Select all

<div style="margin: 0 auto; width:100%; height:200px;"><object type="text/html" data="commentsystem.cgi?boxname=commentbox1" style="width:100%; height:100%; margin:1%;"></object></div>
This next part works with out any problem. It's what's used to add a new comment.

Code: Select all

<form action="commentsystem.cgi" method="get">
<input type="hidden" value="commentbox1" name="boxname">
<input type="hidden" value="http://websitedomain/pagewherecommenttookplace.html" name="pagename">
Name:<input type="text" name="username" size="10" value="anonymous" maxlength="20"><font size="1">(max chars 20)</font><br/><br />

Post a comment:<br/>
<textarea name="cm" maxlength="200"></textarea><br />
<font size="1">(max chars 200)</font><br />
<input type="submit" value="Submit" />


❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ :E ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
User avatar
Sirius
DBB Master
DBB Master
Posts: 5616
Joined: Fri May 28, 1999 2:01 am
Location: Bellevue, WA
Contact:

Re: problem with <object></object>

Post by Sirius »

Works in IE9... but then again.
User avatar
Isaac
DBB Artist
DBB Artist
Posts: 7740
Joined: Mon Aug 01, 2005 8:47 am
Location: 🍕

Re: problem with <object></object>

Post by Isaac »

That's good.

I was thinking of having the CGI file write directly to the html file where the comment box's div layer is. That could be easier to implement.

Just a concept:

1 someone posts a comment from html file

2 python start

3 add new comment:

start=infile.find("<comments go here>")
end=infile.find("</commments>")

4 ...write commments for this page between "start" and "end", when a new comment is made..
5 /python
6 redirect user to same page
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ :E ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
User avatar
Jeff250
DBB Master
DBB Master
Posts: 6539
Joined: Sun Sep 05, 1999 2:01 am
Location: ❄️❄️❄️

Re: problem with <object></object>

Post by Jeff250 »

I've never seen the object tag used like this, but it sounds like it's valid. This is something one would typically use an iframe tag for, but...
Isaac wrote:I was thinking of having the CGI file write directly to the html file where the comment box's div layer is. That could be easier to implement.
This. If I understand you correctly. Make your frontpage entirely a *.cgi page and avoid the iframe stuff all together to pull in the cgi bits. Use <div style="overflow:scroll">foo</div> (or overflow:auto) over the comments to duplicate the scroll bar if that's important.

edit: Also, the usual caveats of allowing your users to post arbitrary html apply here.
User avatar
fliptw
DBB DemiGod
DBB DemiGod
Posts: 6459
Joined: Sat Oct 24, 1998 2:01 am
Location: Calgary Alberta Canada

Re: problem with <object></object>

Post by fliptw »

One would say this could be backed by a database.
User avatar
Isaac
DBB Artist
DBB Artist
Posts: 7740
Joined: Mon Aug 01, 2005 8:47 am
Location: 🍕

Re: problem with <object></object>

Post by Isaac »

Jeff250 wrote:I've never seen the object tag used like this, but it sounds like it's valid. This is something one would typically use an iframe tag for, but...
Isaac wrote:I was thinking of having the CGI file write directly to the html file where the comment box's div layer is. That could be easier to implement.
This. If I understand you correctly. Make your frontpage entirely a *.cgi page and avoid the iframe stuff all together to pull in the cgi bits. Use <div style="overflow:scroll">foo</div> (or overflow:auto) over the comments to duplicate the scroll bar if that's important.

edit: Also, the usual caveats of allowing your users to post arbitrary html apply here.

Yeah, I agree. I had html <> brackets being replaced by empty strings "". I ended up breaking that part of the code, but I've moved on and decided to learn javascript to pass data with out refreshing the page. I think I'll end up using jquery, like you've recommended, but I think it's worth learning the basics of javascript.
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ :E ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
User avatar
Jeff250
DBB Master
DBB Master
Posts: 6539
Joined: Sun Sep 05, 1999 2:01 am
Location: ❄️❄️❄️

Re: problem with <object></object>

Post by Jeff250 »

Why do you need Javascript/jQuery here? Maybe there's a part of your plan I'm not grokking, but I think you're over-complicating things.
User avatar
Isaac
DBB Artist
DBB Artist
Posts: 7740
Joined: Mon Aug 01, 2005 8:47 am
Location: 🍕

Re: problem with <object></object>

Post by Isaac »

Jeff250 wrote:Why do you need Javascript/jQuery here? Maybe there's a part of your plan I'm not grokking, but I think you're over-complicating things.
I'm doing some experiments and there's a few goals I'm shooting for, all for fun. One of them is a simple chess game that runs from client A to server to client B, with out having to refresh the browser. Do I need Jquery? I don't think I do, but probably should learn more about it. I haven't started reading about what all it does yet. I will eventually.
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ :E ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
User avatar
Jeff250
DBB Master
DBB Master
Posts: 6539
Joined: Sun Sep 05, 1999 2:01 am
Location: ❄️❄️❄️

Re: problem with <object></object>

Post by Jeff250 »

Oh I see--yeah, there are ways you could try to get around using Javascript in that case, but Javascript is definitely the cleaner route. I thought you were talking about for your comment system.

edit: Any by Javascript, I mean to include jQuery.
Post Reply