Changing my approach to this problem, I placed
<script language="javascript">
if(document.getElementById('sidebar').style.display=="block") {
document.getElementById('sidebar').style.display="none";
}
</script>
in the home page, and
<script language="javascript">
if(document.getElementById('sidebar').style.display=="none") {
document.getElementById('sidebar').style.display="block";
}
</script>
everywhere else. It achieved the desired effect, but I can't help but feel
dirty...
i.s.
On Thu, May 6, 2010 at 5:11 PM, Iqbal Santyaswardan <[email protected]>wrote:
> Hi,
>
> I have this working:
> <?php echo $ajax->link('Home','/',array('update'=>'content')); ?>
> It worked in replacing the contents of <div id="content">.
>
> But I want to hide another div (<div id='sidebar'>) while doing that.
> Looking through the docs, I surmised that I can attach the function in the
> callback. But how do I do that?
>
> Trying to see how it works, I tried to modify the example code slightly:
> <?php echo
> $ajax->link('Home','/',array('update'=>'content'),array('complete'=>'alert("hello")');
> ?>
>
> but the result is that I get a blank dialog window right after clicking the
> "Home" link, with an "Ok" button and a "Cancel" button. There was no
> "hello" text. Pressing the Ok button proceeded to load my home content into
> the "content" div. Is this more like a confirmation? I know I typed
> "complete" and not "confirm".
>
> Or is this the wrong way to make that div disappear? (is there an easier
> way?) Can someone enlighten me?
>
> Regards,
> Iqbal S.
>
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" 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