* FAQ    * Search  * Register * Login 
Active topics
Unanswered topics

All times are UTC-06:00



Post new topic  Reply to topic  [ 9 posts ] 
Author Message
 Post subject: problem with <object></object>
PostPosted: Mon May 16, 2011 8:04 am 
Offline
DBB Artist
DBB Artist
User avatar

Joined: Mon Aug 01, 2005 8:47 am
Posts: 7124
Location: Ơ̸̦͇̲̬̭̱̰͎̞͈̣͎͚̳ͬ͋̃̀̇͊͂͋͐ͦ̽ͣ̂ͥ͊̅̀̚͠ B̶͖̯͉̜̰̲̓̔͋̈́ͅ È̯ Y̪̤̼͉̠̙͝
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:
<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:
<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└уͭ̂͐̇҉̴̣̼̞̠̯͓̺̞ф̜̊͌̈́̋̏̐́ц̨͔̮̿̇ ̨̛͖̙͖̖̮̗̱ͩ̆͞ͅа̥͇̞̖͚̟̅͐ͤ͞͠͠э̜̘̩̳̬͔̾ͯ̀ͫ̒̐̿ͅͅг̭̖̀ͦ̒̑ͥ̌ͮͫ͞ё͔̟̃ͬ̾̓͟ё̦̞̙̫͔̩͑̀͂ͯ̄̔̃̑̀͠ͅͅ


Top
   
 Post subject: Re: problem with <object></object>
PostPosted: Mon May 16, 2011 10:21 am 
Offline
DBB Master
DBB Master
User avatar

Joined: Fri May 28, 1999 2:01 am
Posts: 5426
ICQ: 28874658
Website: http://www.povterminal.net/
Location: Bellevue, WA
Works in IE9... but then again.


Top
   
 Post subject: Re: problem with <object></object>
PostPosted: Mon May 16, 2011 10:32 am 
Offline
DBB Artist
DBB Artist
User avatar

Joined: Mon Aug 01, 2005 8:47 am
Posts: 7124
Location: Ơ̸̦͇̲̬̭̱̰͎̞͈̣͎͚̳ͬ͋̃̀̇͊͂͋͐ͦ̽ͣ̂ͥ͊̅̀̚͠ B̶͖̯͉̜̰̲̓̔͋̈́ͅ È̯ Y̪̤̼͉̠̙͝
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└уͭ̂͐̇҉̴̣̼̞̠̯͓̺̞ф̜̊͌̈́̋̏̐́ц̨͔̮̿̇ ̨̛͖̙͖̖̮̗̱ͩ̆͞ͅа̥͇̞̖͚̟̅͐ͤ͞͠͠э̜̘̩̳̬͔̾ͯ̀ͫ̒̐̿ͅͅг̭̖̀ͦ̒̑ͥ̌ͮͫ͞ё͔̟̃ͬ̾̓͟ё̦̞̙̫͔̩͑̀͂ͯ̄̔̃̑̀͠ͅͅ


Top
   
 Post subject: Re: problem with <object></object>
PostPosted: Mon May 16, 2011 3:49 pm 
Offline
DBB Master
DBB Master
User avatar

Joined: Sun Sep 05, 1999 2:01 am
Posts: 6377
Location: ☃☃☃
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.


Top
   
 Post subject: Re: problem with <object></object>
PostPosted: Tue May 17, 2011 1:13 pm 
Offline
DBB DemiGod
DBB DemiGod
User avatar

Joined: Sat Oct 24, 1998 2:01 am
Posts: 6415
Location: Calgary Alberta Canada
One would say this could be backed by a database.


Top
   
 Post subject: Re: problem with <object></object>
PostPosted: Tue May 17, 2011 1:44 pm 
Offline
DBB Artist
DBB Artist
User avatar

Joined: Mon Aug 01, 2005 8:47 am
Posts: 7124
Location: Ơ̸̦͇̲̬̭̱̰͎̞͈̣͎͚̳ͬ͋̃̀̇͊͂͋͐ͦ̽ͣ̂ͥ͊̅̀̚͠ B̶͖̯͉̜̰̲̓̔͋̈́ͅ È̯ Y̪̤̼͉̠̙͝
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└уͭ̂͐̇҉̴̣̼̞̠̯͓̺̞ф̜̊͌̈́̋̏̐́ц̨͔̮̿̇ ̨̛͖̙͖̖̮̗̱ͩ̆͞ͅа̥͇̞̖͚̟̅͐ͤ͞͠͠э̜̘̩̳̬͔̾ͯ̀ͫ̒̐̿ͅͅг̭̖̀ͦ̒̑ͥ̌ͮͫ͞ё͔̟̃ͬ̾̓͟ё̦̞̙̫͔̩͑̀͂ͯ̄̔̃̑̀͠ͅͅ


Top
   
 Post subject: Re: problem with <object></object>
PostPosted: Tue May 17, 2011 2:23 pm 
Offline
DBB Master
DBB Master
User avatar

Joined: Sun Sep 05, 1999 2:01 am
Posts: 6377
Location: ☃☃☃
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.


Top
   
 Post subject: Re: problem with <object></object>
PostPosted: Tue May 17, 2011 3:17 pm 
Offline
DBB Artist
DBB Artist
User avatar

Joined: Mon Aug 01, 2005 8:47 am
Posts: 7124
Location: Ơ̸̦͇̲̬̭̱̰͎̞͈̣͎͚̳ͬ͋̃̀̇͊͂͋͐ͦ̽ͣ̂ͥ͊̅̀̚͠ B̶͖̯͉̜̰̲̓̔͋̈́ͅ È̯ Y̪̤̼͉̠̙͝
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└уͭ̂͐̇҉̴̣̼̞̠̯͓̺̞ф̜̊͌̈́̋̏̐́ц̨͔̮̿̇ ̨̛͖̙͖̖̮̗̱ͩ̆͞ͅа̥͇̞̖͚̟̅͐ͤ͞͠͠э̜̘̩̳̬͔̾ͯ̀ͫ̒̐̿ͅͅг̭̖̀ͦ̒̑ͥ̌ͮͫ͞ё͔̟̃ͬ̾̓͟ё̦̞̙̫͔̩͑̀͂ͯ̄̔̃̑̀͠ͅͅ


Top
   
 Post subject: Re: problem with <object></object>
PostPosted: Tue May 17, 2011 9:06 pm 
Offline
DBB Master
DBB Master
User avatar

Joined: Sun Sep 05, 1999 2:01 am
Posts: 6377
Location: ☃☃☃
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.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 9 posts ] 

All times are UTC-06:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Descent'rs have piloted these pages
 
The layout and contents contained within this site are © DescentBB.net 1997-2006.
Descent, Descent II are © Parallax Software Corporation.
Descent III is Outrage Entertainment.
Descent is a Trademark of Interplay Productions.

Miner Wars™ is trademark of Keen Software House s. r. o.
.


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group