On Mon, Sep 15, 2008 at 10:26:46AM +0200, Andrew Beekhof wrote:
> On Mon, Sep 15, 2008 at 08:28, Lars Ellenberg <[EMAIL PROTECTED]> wrote:
> >
> > if we set aside confused admins for the moment,
> > and assume CRM is the only entity promoting/demoting drbd.
> 
> A very important assumption.
> 
> Without it, it doesn't matter how much redundancy you add, you'll
> always have a split brain/personality.
> 
> You can't put the cluster in charge, tell it to go in one direction,
> and then start trying to go off in another.  That path leads to
> madness for the cluster  here?I want the menu1 to be the same as menulist
>>> </script>
>>>
>>
>> Hello,
>> you could use json_encode() to encode your array in php to the json format
>> and then print it out from php inside the html, then decode the array using
>> js's json functions.
>> But as long as you do that you could print it straightforward, just write
>> from php the "html" code that defines the array in js.
>
> +1 for json... below is what you need to do:
>
> <script type="text/javascript">
> var menu1= eval( '(' + <?php echo json_encode($menulist); ?> ')' );
> </script>

Whoops.... it's a bit late.  You don't even need to bother with the
eval stuff.  using eval becomes important when you are using the
xmlHTTPRequest.

just:
<script>
var menu1 = <?php echo json_encode($menulist); ?>;
</script>

Regards,
John Campbell
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to