Hi Dave,
> Your book is on my Amazon Wishlist for weeks, really...
> I'm really impressed :-)
shucks, you'll make me blush...
In germany we call this "jemandem Honig ums Maul schmieren" - in a
literal interpretation this means "greasing honey around s.o. mouth", in
english it means "to butter s.o. up", afaik ;-)
The simple solution is to declare posX and posY as global
variables, i.e.
yes, it works! Thank you very much.
Now I can use the Ajax.inplaceEditor, writing Form-Values and Position
of the Memo into my database like this:
/* Ajax Inplace-Editor */
new Ajax.InPlaceEditor(notice_content,
'/index.php?action=save_notice&qstn='+question_id,
{
okText:"Speichern",cols:25,rows:10,cancelText:"[Verwerfen]",
loadTextURL:"/index.php?action=get_notice_txt&qstn_id="+question_id+"&us
er_id="+user_id+"&plain_text=true",
loadingText:"Lade Inhalt...",
savingText:"Speichere Notiz...<br/><img
src='/media/img/notice_progress.gif' />",
highlightendcolor:'#FFFF00',highlightcolor:'#FFFFC1',
callback: function(notice_content, value)
{ return 'value='+escape(value)+'&x='+posX+'&y='+posY }
}
);
Same approach
as a lot of
languages I've come across (PHP is the odd one out here, with
the global
keyword, which is always tripping me up.)
Using global variables in this way is a punishable offence
from a design
perspective, of course (and, yes, el and el2 are globals
too).
Yes, I usally code PHP - and I know, that globals are mostly "bad".
But in this case, I accept that. I'm still learning, and for the
beginning this solution is ok. Especially 'cause this is no production
code... only for "personal use" ;-)
As your code
grows, you don't want to have hundreds of globals littering
up your script,
so roll your code up into objects, or at least define the globals as
higher-level structures, e.g.
thanks for this alternative - I'll have a look at it, I think...
Cheers,
Daniel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on
Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---