On Jan 15, 2008 9:56 PM, Julien <[EMAIL PROTECTED]> wrote:
>
> Hi, I'm very new to cake.
>
> I'm currently doing the blog tutorial (http://manual.cakephp.org/
> appendix/blog_tutorial). And I've noticed that in the index view there
> is no <script> tag, but when you click on a link to delete a post
> there is an alert that pops up with a warning. But I was looking for
> the javascript behind this and I did not find any script tag inside
> the page's html.
> So my question is : How on earth is this possible? I mean, to include
> some Javascript without a script tag (!!!).
> In the <a> tag there is an onclick event in which there is a
> function :
> return confirm('Are you sure ?')
>
> And I know that there is something to do with HtmlHelper, but again,
> I'm very new to Cake so I would be very interrested to know the answer
> for this enigma. :-S
>
No script tag is necessary. All of the javascript is inline in the
tag. confirm() is a built-in javascript function. If it were, instead:
a onclick="yourFancyConfirmFunction('Are you sure?');" ...
and was working without any script loaded, THEN you'd have an enigma.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---