Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #2784

Re: to fill a select with json javascript from arrays

From Jerry Stuckle <jstucklex@attglobal.net>
Newsgroups comp.lang.php
Subject Re: to fill a select with json javascript from arrays
Date 2011-08-10 17:19 -0400
Organization A noiseless patient Spider
Message-ID <j1usm0$bhc$3@dont-email.me> (permalink)
References <1bvj3wor4c13g.yba8pdm1yhnv$.dlg@40tude.net> <4e427ea9$0$23883$e4fe514c@news2.news.xs4all.nl> <17koe79k116aj.10mw3uyf7ueba$.dlg@40tude.net> <j1uevm$5il$1@dont-email.me> <j1un8i$6fj$2@dont-email.me>

Show all headers | View raw


On 8/10/2011 3:48 PM, Bill B wrote:
> On 8/10/2011 1:26 PM, Jerry Stuckle wrote:
>> On 8/10/2011 12:16 PM, nawfer wrote:
>>>> This is actually a JavaScript/JSON question.
>>>
>>> but in the first step how can take the array php and have array js?
>>> I read json is solution but which is the correct code that can to work
>>> with
>>> my type of php array?
>>
>> You have to understand - PHP runs on the server, and javascript on the
>> client. By the time your javascript code executes, PHP has completed its
>> execution and terminated.
>>
>> So what you have to do in your PHP code is create the javascript code to
>> build the array then send the javascript code to the client.
>
> Jerry, out of curiosity, with the information you have, is there
> solution that is only PHP?
>
> Bill B

Not if he wants to use json.  Other than that, I have no idea what he's 
trying to do.  But if it requires execution on the client, then 
obviously not.  However, if it could all be done server-side, then it 
easily could.

But reading between the lines, I suspect he's using AJAX to refresh part 
of a page after a search is performed.  I don't know, though, and could 
be way off.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

to fill a select with json javascript from arrays nawfer <novalidsforspam@alt.al> - 2011-08-10 14:13 +0200
  Re: to fill a select with json javascript from arrays Erwin Moller <Since_humans_read_this_I_am_spammed_too_much@spamyourself.com> - 2011-08-10 14:51 +0200
    Re: to fill a select with json javascript from arrays nawfer <novalidsforspam@alt.al> - 2011-08-10 18:16 +0200
      Re: to fill a select with json javascript from arrays Jerry Stuckle <jstucklex@attglobal.net> - 2011-08-10 13:26 -0400
        Re: to fill a select with json javascript from arrays Bill B <me@privacy.net> - 2011-08-10 15:48 -0400
          Re: to fill a select with json javascript from arrays Jerry Stuckle <jstucklex@attglobal.net> - 2011-08-10 17:19 -0400
      Re: to fill a select with json javascript from arrays Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-08-11 22:50 +0200
        Re: to fill a select with json javascript from arrays Bill B <me@privacy.net> - 2011-08-11 17:05 -0400
          Re: to fill a select with json javascript from arrays Jerry Stuckle <jstucklex@attglobal.net> - 2011-08-11 19:53 -0400
            Re: to fill a select with json javascript from arrays Bill B <me@privacy.net> - 2011-08-11 23:24 -0400
              Re: to fill a select with json javascript from arrays Jerry Stuckle <jstucklex@attglobal.net> - 2011-08-12 06:39 -0400
        Re: to fill a select with json javascript from arrays Paul Herber <paul@pherber.com> - 2011-08-11 22:56 +0100
          Re: to fill a select with json javascript from arrays Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-08-12 00:42 +0200
  Re: to fill a select with json javascript from arrays Denis McMahon <denis.m.f.mcmahon@gmail.com> - 2011-08-11 00:12 +0000

csiph-web