You Can't use <script ..... src=....> and include js betweeen the script
tags,
i.e. you need this
<html>
<head>
<title>Test</title>
<script type="text/javascript" src="app/webroot/js/prototype.js"></script>
<script type="text/javascript">
function execute() {
var item = $('sample');
Element.update(item, "Hello!");
}
</script>
</head>
<body>
<div id="sample" style="background-color:red;">element</div>
<div id="sample2" style="background-color:green">element2</div>
<button onclick="execute()">Click</button>
</body>
</html>
skyblueink wrote:
> I know this is not a CakePHP problem, but related to it. The simple
> example below does not work in IE and FireFox. I don't why, but the
> PHPEd debugger gives a messge "OBJECT is required". I have some
> experiences in using prototype in CakePHP, but I'm trying to go more
> deep into prototype by learning itself.
>
> <html>
> <head>
> <title>Test</title>
> <script type="text/javascript" src="http://localhost/test/
> prototype.js">
> function execute() {
> var item = $('sample');
> Element.update(item, "Hello!");
> }
> </script>
> </head>
>
> <body>
> <div id="sample" style="background-color:red;">element</div>
> <div id="sample2" style="background-color:green">element2</div>
> <button onclick="execute()">Click</button>
> </body>
> </html>
>
>
> >
--
*/Jeremy Pointer/*
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
MSN: [EMAIL PROTECTED]
My status <skype:jermworm?call>
Get Skype <http://www.skype.com/go/download> and call me for free.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
begin:vcard
fn:Jeremy Pointer
n:Pointer;Jeremy
adr:;;Box 499;Krugersdorp;Gauteng;1740;South Africa
email;internet:[EMAIL PROTECTED]
tel;work:+27 11 665-2445
tel;fax:+27 86 5013109
tel;cell:+27 82 3724769
x-mozilla-html:TRUE
version:2.1
end:vcard