Skip Menu |

This queue is for tickets about the HTML-Prototype CPAN distribution.

Report information
The Basics
Id: 16283
Status: resolved
Priority: 0/
Queue: HTML-Prototype

People
Owner: perl [...] intertivityNOSP4M.com
Requestors: nadine.and.henry [...] pobox.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.36
Fixed in: (no value)



Subject: in_place_edit generates javascript error
Using Perl 5.8.7 see attachment for code that produces this error.
#!/usr/bin/perl use HTML::Prototype; print "Content-type: text/html\n\n"; my $p = HTML::Prototype->new(); my $js = $p->define_javascript_functions; my $editor = $p->in_place_editor ('myUpdate',{ url => '/'}); print <<END; <html> <head> $js </head> <body> $editor <span id="myUpdate"> Click here to enter the editor </span> </body> </html> END __END__ When using Mozilla Firefox 1.07 I get the following in the Javascript Console: Error: this.element has no properties Source File: http://mod.localdomain/cgi-bin/in_place_edit_bug.html Line: 2249 and the text in the myUpdate span: Click here to enter the editor is not highlighted when the mouse hovers over it. In other words, the in place editor cannot be activated.
From: LAXEN
[LAXEN - Sun Dec 4 15:50:42 2005]: Show quoted text
> Using Perl 5.8.7 > see attachment for code that produces this error.
Sorry, it was my error. The problem occurs if the id referenced in the $prototype->in_place_editor call doesn't exist yet. In other words, instead of: <html> <head> $js </head> <body> $editor <span id="myUpdate"> Click here to enter the editor </span> </body> </html> I should have written: <html> <head> $js </head> <body> <span id="myUpdate"> Click here to enter the editor </span> $editor </body> </html> ------------------------------------------------------------------ Sorry, I hope you didn't spend any time on this Henry Laxen