dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: What architecture to use for grid with external content

  1. #1
    Join Date
    Nov 2017
    Posts
    1

    Question What architecture to use for grid with external content

    Hi,

    I'm using a javascript library which has a function which takes a callback like this:

    Code:
    steem.api.getContent(author, permlink, function(err, result) {
      console.log(err, result);
    });
    I have a list of author/permlink combinations. Later this list will be made available from a database but for now just "a list" (from a file or static). I want to show a grid with in each cell some information that is available in 'result'. I'm not sure how to do this in a manageable way.

    I don't know if I should make this grid up in php or in javascript. What is important is that the order of the items remains unaltered.

    Can someone advice on how to approach this?

    Thanks,
    Jef

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    22,231
    I don't think I have enough info to really know for sure, but it sounds like at least initially it could be done fairly simply in PHP if you want it on the server side. Simplest case, if you have the data in a JSON file, for example, you could just serve it up with:
    PHP Code:
    <?php
    $file 
    'path/to/data.json';
    if(
    file_exists($file) and is_readable($file)) {
      
    header('Content-Type: application/json');
      
    readfile($file);
    }
    else {
      
    header ('HTTP/1.0 404 Not Found');
    }
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center