Ioannis,

I wouldn't spend a lot of time trying to figure out why document.write() 
isn't working for you. It's not what you want to use anyway.

What you want to do is manipulate the DOM to update portions of the 
screen dynamically -- at least it seems that's what you want. You can do 
this with JavaScript, but it's rather complicated, and given your stated 
level of experience with JavaScript I would suggest you look to a 
JavaScript library that is written specifically to make this sort of 
task easier.

My library of choice is jQuery (http://jQuery.com). It's fantastic. It 
has a very active and loyal community that are willing and able to 
answer any questions you'd like.

I'm coding something like what you're describing right now, and I'm 
using jQuery to accomplish it. In the past I would have used IE's 
innerHTML to get the job done, but that only works in IE (at least I 
don't think it works in FF).

(note this snippet is not a working piece of code)
ThisRow = "";
ThisRow += "<div class=\"OrderEntryListRow " + RowClass + "\" 
RowType=\"" + RowClass + "\">\n";
ThisRow += "<span class=\"Date Cell\">" + ThisDate + "</span> \n";
ThisRow += "<span class=\"CostCenter Cell\">" + CostCenterName + 
"</span> \n";
ThisRow += "<span class=\"ShiftName Cell\">" + ShiftName + "</span> \n";
ThisRow += "<span class=\"Classification Cell\">" + Classification + 
"</span> \n";
ThisRow += "<span class=\"Quantity Cell\">" + Quantity + "</span>\n";
ThisRow += "</div>";
$("##OrderList").append(ThisRow);

You can see that I'm using normal JavaScript to create a string of HTML 
which is stored as a string in the variable "ThisRow". I then use jQuery 
to append that string to an element. In this case that element is a div 
(not shown) with an ID of OrderList. In jQuery, you can match all 
elements that have a specific ID or class or attribute, etc. The 
#OrderList tells it to look for an element whose ID is OrderList. I'm 
using ## because I'm within ColdFusion cfoutput tags, so I need to 
escape the single #.
This is a very simple example, but it does what you're looking to do. 
jQuery also has ajax capability. In fact, the snippet above is in the 
middle of an ajax call -- it gets executed upon success of the call.

The other good news is that Rob Gonda will soon be releasing an AjaxCFC 
plug-in for jQuery! Yay! Right now, I've had to change the way I call 
CFCs in jQuery, but as soon at Rob's plug-in becomes publicly available 
it will change everything for ColdFusion jQuery users. I've been testing 
an advanced copy and it's pretty cool stuff.

So to sum up: my advice is to check out jQuery. Sign up for the mailing 
list (discuss@jQuery.com) here <http://jquery.com/discuss/>, and speak 
up. Folks are more than willing to help new comers.

I hope this helps.

Cheers,
Chris



Ioannis Papanikolaou wrote:
> It works smoothly with alert(r);
>
> Any other way to try to display it ?( what I want to do is to display the 
> results of the output form my server to a specific DIV on my first page. The 
> page is kind of dynamic content displaying info).
>
> I am using the Beta version as you said. The errors I am getiing are:
>
> a)On the console tag: the request field is keep loading for ever even thought 
> the requested content has been dispalyed in my screen already.
>
> b)On the Script tag the debbuger has stoped on util.js, line 271 
> "$('disabledZone').style.visibility = 'hidden';"
>
> this probably produses the alert I had mention before. 
>
> Do you think my javascript synatax is wrong (my level is quite basic on 
> Javascript)
>
> Thanx a a lot
>
> Ioannis   
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:265572
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to