Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Supporting Technologies > HTML and JavaScript

Reply
 
Thread Tools Rate Thread Display Modes
Old 11-07-2004, 11:11 AM   #1
avelives
"the dude abides..!"
 
avelives's Avatar
 
Join Date: Apr 2002
Location: UK
Posts: 365
Send a message via AIM to avelives Send a message via Yahoo to avelives
Default Refreshing individual table cells ??

I have looked around for information on this but cannot find anything, i basically want to have a table which can refresh its individual cells without reloading the whole page ?

Is this possible and if so how ??
avelives is offline   Reply With Quote
Old 11-07-2004, 12:51 PM   #2
petefs
Fried Onions
 
petefs's Avatar
 
Join Date: Apr 2004
Location: Chicago, IL
Posts: 1,328
Send a message via AIM to petefs Send a message via MSN to petefs Send a message via Yahoo to petefs
Default

it can be done with JavaScript ^_^ Do a search for 'javascript dhtml tbody' on google and you should turn some things up -- if you can't find anything that makes sense I can post an example later on in the day. just let me know : )
petefs is offline   Reply With Quote
Old 11-07-2004, 03:45 PM   #3
avelives
"the dude abides..!"
 
avelives's Avatar
 
Join Date: Apr 2002
Location: UK
Posts: 365
Send a message via AIM to avelives Send a message via Yahoo to avelives
Default

Thanks ill keep looking but so far most of what im finding is either making little sense or is not quite what im after

(im not so good at Javascript so forgive my ignorance)

If you could post an example that would be great, basically i have 9 cell table where i want the middle cell to refresh when you click various menu buttons in the left navigation cell.

So only the middle cell needs to update and it will basically load in new flash movies.
If you cant post the code point me in the direction of a concise tutorial as i am loathed to learn any more than i need in regards to this.
Thanks for any help in advance..

avelives is offline   Reply With Quote
Old 11-07-2004, 04:30 PM   #4
petefs
Fried Onions
 
petefs's Avatar
 
Join Date: Apr 2004
Location: Chicago, IL
Posts: 1,328
Send a message via AIM to petefs Send a message via MSN to petefs Send a message via Yahoo to petefs
Default

well then, that should be a big problem : ) I'm not testing this quite yet, but this should work:

set up your table as such:
Code:
<table>
<tbody>
    <tr>
        <td id='content'>
        </td>
    </tr>
</tbody>
</table>
just make sure that the td that you want to change has an id, basically : )

then your javascript
Code:
function editTableCell(html)
{
    var tcell = document.getElementById('content');
    tcell.innerHTML = html;
}
I'm not sure what you want to use to change the cell, but if it were flash (for example):

ActionScript Code:
var cell_html = "My dog has fleas."; getURL("javascript:editTableCell('"+cell_html+"');");

that should do it -- let me know if it works ^_^ feel free to AIM me if you have any other questions, and once we get a working solution we can post it back up here in case anybody else ever has the same question.
petefs is offline   Reply With Quote
Old 11-07-2004, 04:33 PM   #5
petefs
Fried Onions
 
petefs's Avatar
 
Join Date: Apr 2004
Location: Chicago, IL
Posts: 1,328
Send a message via AIM to petefs Send a message via MSN to petefs Send a message via Yahoo to petefs
Default

by the way -- nice site. Doesn't come up in firefox for some reason, but I think my firefox has been acting up anyway. A little hard on the eyes, but nice and sexy ^_^
petefs is offline   Reply With Quote
Old 11-07-2004, 06:47 PM   #6
avelives
"the dude abides..!"
 
avelives's Avatar
 
Join Date: Apr 2002
Location: UK
Posts: 365
Send a message via AIM to avelives Send a message via Yahoo to avelives
Default

Thanks for all the above !!
Its 7pm here in the UK and even i dont work this late on a sunday, so ill mess around with the script you provided tomorrow and see if i can get it working.

If i have any more probs ill be in touch, and thanks again for this, if i can get it to work ill be well happy
avelives is offline   Reply With Quote
Old 11-08-2004, 11:49 AM   #7
avelives
"the dude abides..!"
 
avelives's Avatar
 
Join Date: Apr 2002
Location: UK
Posts: 365
Send a message via AIM to avelives Send a message via Yahoo to avelives
Default

IT WORKS !!
Thanks man, much appreciated......

However is it possible that rather than updating the cell with new HTML text, that i can replace the cells contents with a FLASH movie.

I tried formatting the HTML code which is embedded to display a flash movie and putting that formatted code into the
Code:
var cell_html = "My dog has fleas.";
Like so
Code:
var cell_html = "<TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Arial\" SIZE=\"8\" COLOR=\"#000000\">&lt;object classid=&quot;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0&quot; width=&quot;80&quot; height=&quot;40&quot; id=&quot;Tabletest1&quot; align=&quot;middle&quot;&gt;&lt;param name=&quot;allowScriptAccess&quot; value=&quot;sameDomain&quot; /&gt;&lt;param name=&quot;movie&quot; value=&quot;Tabletest1.swf&quot; /&gt;&lt;param name=&quot;quality&quot; value=&quot;high&quot; /&gt;&lt;param name=&quot;bgcolor&quot; value=&quot;#ffffff&quot; /&gt;&lt;embed src=&quot;Tabletest1.swf&quot; quality=&quot;high&quot; bgcolor=&quot;#ffffff&quot; width=&quot;80&quot; height=&quot;40&quot; name=&quot;Tabletest1&quot; align=&quot;middle&quot; allowScriptAccess=&quot;sameDomain&quot; type=&quot;application/x-shockwave-flash&quot; pluginspage=&quot;http://www.macromedia.com/go/getflashplayer&quot; /&gt;&lt/object&gt;</FONT></P></TEXTFORMAT>";
However this doesnt seem to work and im not sure why...if you could figure out a way to do this itd be great if not just point me in the direction of a decent tutorial relating to it and ill try myself..

Other than that thanks as your code works great !!
avelives is offline   Reply With Quote
Old 11-08-2004, 04:24 PM   #8
petefs
Fried Onions
 
petefs's Avatar
 
Join Date: Apr 2004
Location: Chicago, IL
Posts: 1,328
Send a message via AIM to petefs Send a message via MSN to petefs Send a message via Yahoo to petefs
Default

you'll have to reconstruct those html-entities in the javascript function. I'm not exactly a JS guru so I'm not familiar with the method for that in JS. : ) I suggest you make a template in the javascript function and just pass the .swf url into it as a variable? That way you won't have to have those huge ugly looking strings in flash : )
petefs is offline   Reply With Quote
Old 02-24-2005, 04:35 PM   #9
linguini genie
Pastamancer
 
Join Date: Feb 2005
Location: Zagreb/London
Posts: 1
Default

I have a query very similar to this one.

I want to refresh three of the cells in a table using a button on another part of the page.


I would like to have a function where each button on the navigation menu changes the contents of a table on the page. One image and two or three hyperlinks are the contents to be changed each time.

There's no Flash involved but I'm a complete novice with Javascript, I really don't know where anything goes.

I'd really appreciate some help if anyone can spare the time.
linguini genie is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:43 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.