Welcome Guest, Not a member yet? Register   Sign In
Possible to produce a javascript function from PHP?
#1

[eluser]Robb__[/eluser]
I have a problem I just can't solve. I retrieve a picture from my database that gets loaded as below in getclicklist.


Code:
function getclicklist($id)
    {
    $this->load->model('Load');
    $result = $this->Load->getclicklist($id);
     $resultrow[0] = $result ->row(0);
     $images['Image'] = $resultrow[0] ->Image;
    
     ... something here to produce the outcome below
    
echo $response;
        
        }

The result from this function in the controller should return something to my response function (this is done with AJAX). And in the end produce something that looks like this.

Code:
function show_get_clicklist_response(response) {
    eval(response.responseText)    

YAHOO.example.container.photobox = new YAHOO.widget.PhotoBox("photobox",
                {
                    effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.45},
                    fixedcenter:true,
                    constraintoviewport:true,
                    underlay:"none",
                    close:true,
                    visible:false,
                    draggable:true,
                    modal:true,
                    photos:[{src:"http://static.flickr.com/51/129586913_e78683c466.jpg",caption:"Linus"}, //these image adresses are the core component in the function, and where I would like to put the adress retrieved from getclicklist
                            {src:"http://static.flickr.com/50/129590195_0642f2d96a.jpg",caption:"Linus 2"},
                            {src:"http://static.flickr.com/8/12669712_be928a0d97.jpg",caption:"Dobb's Ferry, NY"},
                           ],
                    width:"500px"
                } );
                YAHOO.example.container.photobox.render();
                
                YAHOO.util.Event.addListener("show", "click", YAHOO.example.container.photobox.show, YAHOO.example.container.photobox, true);
    }

Is this possible? I have not come up with any way to manipulate javascript functions, this is the only way I can see work.


Messages In This Thread
Possible to produce a javascript function from PHP? - by El Forum - 09-04-2007, 12:47 PM
Possible to produce a javascript function from PHP? - by El Forum - 09-04-2007, 01:50 PM
Possible to produce a javascript function from PHP? - by El Forum - 09-05-2007, 07:21 AM
Possible to produce a javascript function from PHP? - by El Forum - 09-05-2007, 11:04 AM
Possible to produce a javascript function from PHP? - by El Forum - 09-05-2007, 11:43 AM
Possible to produce a javascript function from PHP? - by El Forum - 09-06-2007, 04:30 AM
Possible to produce a javascript function from PHP? - by El Forum - 09-07-2007, 08:52 AM
Possible to produce a javascript function from PHP? - by El Forum - 09-07-2007, 09:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB