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: 7127
Joined: Mon Aug 01, 2005 8:47 am
Location: Ơ̸̦͇̲̬̭̱̰͎̞͈̣͎͚̳ͬ͋̃̀̇͊͂͋͐ͦ̽ͣ̂ͥ͊̅̀̚͠ B̶͖̯͉̜̰̲̓̔͋̈́ͅ È̯ Y̪̤̼͉̠̙͝

problem with <object></object>

Post by Isaac » Mon May 16, 2011 8:04 am

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" />


s☼-£♦и̫͍ͥ̍ͪ͌̓͗͡о̡̹̱͊̅ͮ̓̕͢б̧̝̻̪̤̳̜͐̓̉ͤ͢͜ ͙̬͙̆̑ͮ̐ͭ̾̂́͘i̎̌̾̓̽̀̈̓̀҉͉̙̦͎̘̝͕f̻͕͔̘ͣͣ̓͊̿͢͜ ͍͔͈͕̮̫ͣ̆ͮ̊͋/♂6Æ!♪╩"▲L└уͭ̂͐̇҉̴̣̼̞̠̯͓̺̞ф̜̊͌̈́̋̏̐́ц̨͔̮̿̇ ̨̛͖̙͖̖̮̗̱ͩ̆͞ͅа̥͇̞̖͚̟̅͐ͤ͞͠͠э̜̘̩̳̬͔̾ͯ̀ͫ̒̐̿ͅͅг̭̖̀ͦ̒̑ͥ̌ͮͫ͞ё͔̟̃ͬ̾̓͟ё̦̞̙̫͔̩͑̀͂ͯ̄̔̃̑̀͠ͅͅ
User avatar
Sirius
DBB Master
DBB Master
Posts: 5435
Joined: Fri May 28, 1999 2:01 am
Location: Bellevue, WA
Contact:

Re: problem with <object></object>

Post by Sirius » Mon May 16, 2011 10:21 am

Works in IE9... but then again.
User avatar
Isaac
DBB Artist
DBB Artist
Posts: 7127
Joined: Mon Aug 01, 2005 8:47 am
Location: Ơ̸̦͇̲̬̭̱̰͎̞͈̣͎͚̳ͬ͋̃̀̇͊͂͋͐ͦ̽ͣ̂ͥ͊̅̀̚͠ B̶͖̯͉̜̰̲̓̔͋̈́ͅ È̯ Y̪̤̼͉̠̙͝

Re: problem with <object></object>

Post by Isaac » Mon May 16, 2011 10:32 am

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
s☼-£♦и̫͍ͥ̍ͪ͌̓͗͡о̡̹̱͊̅ͮ̓̕͢б̧̝̻̪̤̳̜͐̓̉ͤ͢͜ ͙̬͙̆̑ͮ̐ͭ̾̂́͘i̎̌̾̓̽̀̈̓̀҉͉̙̦͎̘̝͕f̻͕͔̘ͣͣ̓͊̿͢͜ ͍͔͈͕̮̫ͣ̆ͮ̊͋/♂6Æ!♪╩"▲L└уͭ̂͐̇҉̴̣̼̞̠̯͓̺̞ф̜̊͌̈́̋̏̐́ц̨͔̮̿̇ ̨̛͖̙͖̖̮̗̱ͩ̆͞ͅа̥͇̞̖͚̟̅͐ͤ͞͠͠э̜̘̩̳̬͔̾ͯ̀ͫ̒̐̿ͅͅг̭̖̀ͦ̒̑ͥ̌ͮͫ͞ё͔̟̃ͬ̾̓͟ё̦̞̙̫͔̩͑̀͂ͯ̄̔̃̑̀͠ͅͅ
User avatar
Jeff250
DBB Master
DBB Master
Posts: 6387
Joined: Sun Sep 05, 1999 2:01 am
Location: ☃☃☃

Re: problem with <object></object>

Post by Jeff250 » Mon May 16, 2011 3:49 pm

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: 6415
Joined: Sat Oct 24, 1998 2:01 am
Location: Calgary Alberta Canada

Re: problem with <object></object>

Post by fliptw » Tue May 17, 2011 1:13 pm

One would say this could be backed by a database.
User avatar
Isaac
DBB Artist
DBB Artist
Posts: 7127
Joined: Mon Aug 01, 2005 8:47 am
Location: Ơ̸̦͇̲̬̭̱̰͎̞͈̣͎͚̳ͬ͋̃̀̇͊͂͋͐ͦ̽ͣ̂ͥ͊̅̀̚͠ B̶͖̯͉̜̰̲̓̔͋̈́ͅ È̯ Y̪̤̼͉̠̙͝

Re: problem with <object></object>

Post by Isaac » Tue May 17, 2011 1:44 pm

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.
s☼-£♦и̫͍ͥ̍ͪ͌̓͗͡о̡̹̱͊̅ͮ̓̕͢б̧̝̻̪̤̳̜͐̓̉ͤ͢͜ ͙̬͙̆̑ͮ̐ͭ̾̂́͘i̎̌̾̓̽̀̈̓̀҉͉̙̦͎̘̝͕f̻͕͔̘ͣͣ̓͊̿͢͜ ͍͔͈͕̮̫ͣ̆ͮ̊͋/♂6Æ!♪╩"▲L└уͭ̂͐̇҉̴̣̼̞̠̯͓̺̞ф̜̊͌̈́̋̏̐́ц̨͔̮̿̇ ̨̛͖̙͖̖̮̗̱ͩ̆͞ͅа̥͇̞̖͚̟̅͐ͤ͞͠͠э̜̘̩̳̬͔̾ͯ̀ͫ̒̐̿ͅͅг̭̖̀ͦ̒̑ͥ̌ͮͫ͞ё͔̟̃ͬ̾̓͟ё̦̞̙̫͔̩͑̀͂ͯ̄̔̃̑̀͠ͅͅ
User avatar
Jeff250
DBB Master
DBB Master
Posts: 6387
Joined: Sun Sep 05, 1999 2:01 am
Location: ☃☃☃

Re: problem with <object></object>

Post by Jeff250 » Tue May 17, 2011 2:23 pm

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: 7127
Joined: Mon Aug 01, 2005 8:47 am
Location: Ơ̸̦͇̲̬̭̱̰͎̞͈̣͎͚̳ͬ͋̃̀̇͊͂͋͐ͦ̽ͣ̂ͥ͊̅̀̚͠ B̶͖̯͉̜̰̲̓̔͋̈́ͅ È̯ Y̪̤̼͉̠̙͝

Re: problem with <object></object>

Post by Isaac » Tue May 17, 2011 3:17 pm

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.
s☼-£♦и̫͍ͥ̍ͪ͌̓͗͡о̡̹̱͊̅ͮ̓̕͢б̧̝̻̪̤̳̜͐̓̉ͤ͢͜ ͙̬͙̆̑ͮ̐ͭ̾̂́͘i̎̌̾̓̽̀̈̓̀҉͉̙̦͎̘̝͕f̻͕͔̘ͣͣ̓͊̿͢͜ ͍͔͈͕̮̫ͣ̆ͮ̊͋/♂6Æ!♪╩"▲L└уͭ̂͐̇҉̴̣̼̞̠̯͓̺̞ф̜̊͌̈́̋̏̐́ц̨͔̮̿̇ ̨̛͖̙͖̖̮̗̱ͩ̆͞ͅа̥͇̞̖͚̟̅͐ͤ͞͠͠э̜̘̩̳̬͔̾ͯ̀ͫ̒̐̿ͅͅг̭̖̀ͦ̒̑ͥ̌ͮͫ͞ё͔̟̃ͬ̾̓͟ё̦̞̙̫͔̩͑̀͂ͯ̄̔̃̑̀͠ͅͅ
User avatar
Jeff250
DBB Master
DBB Master
Posts: 6387
Joined: Sun Sep 05, 1999 2:01 am
Location: ☃☃☃

Re: problem with <object></object>

Post by Jeff250 » Tue May 17, 2011 9:06 pm

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