Results 1 to 3 of 3

Thread: help me analize this code

  1. #1
    Join Date
    Mar 2010

    help me analize this code

    can you explain something in this code for me?
    on line 327, the part where they display the videos is confusing to me
    their variables for each video look like this {{path}}, {{thumbnail}}
    where are these variables coming from? ive checked all the other .js files linked in the page and cant find another reference to them
    <script id='search-broadcasts' type='text/html'>
    <li class='broadcasts result archive video clearfix'>
    <div class='cap_and_profile'>
    <a class='thumb' href='{{path}}'>
    <img class='cap' src='{{thumbnail}}'>
    <a class='profile' href='{{profilePath}}'>
    <img class='p50' src='{{profileImage}}'>
    <div class='video_meta'>
    <p class='title'>
    <img alt='Recorded' class='video_type' src='/images/xarth/g/g18_camera-00000080.png'>
    <a href='{{path}}'>
    Untitled Broadcast
    <p class='video_stats search_topstats'>
    <span class='stat channelname'>
    <a href='{{profilePath}}'>{{user}}</a>
    <a href='{{gamePath}}'>{{game}}</a>
    <p class='desc'>
    <span class='content'>{{description}}</span>
    <p class='video_stats'>
    <span class='stat time_ago'>
    <time datetime='{{startTime}}'></time>
    <span class='stat length'>{{length}}</span>
    <span class='stat views_count'>{{views}}</span>
    <div class='ad_leader search_leader'>
    <div class='advertisement'>
    <div class="ad_leader" id="Twitch_DirLeaderv2_holder" name="Twitch_DirLeaderv2"><div id="Twitch_DirLeaderv2_load_text"></div></div>
        if (window.cbsiSlotConfigs == null) { window.cbsiSlotConfigs = {}; }
        cbsiSlotConfigs["Twitch_DirLeaderv2"] = {
          'SP': '15',
          'POS': '300',
          'WIDTH': '970',
          'HEIGHT': '66',
          'AD_SZ': '728wX90h',
          'CALLBACK': {
              onload: function(params) {
                  if (params.isBlank === "1") {

  2. #2
    Join Date
    Jul 2008
    urbana, il
    those are template variable placeholders. notice the non-js <script> block?
    looks like a mustache or handlebars template to me, but there's lots of different ones...

    the actual values typically come from an object, typically provided by jsonp/ajax.
    Create, Share, and Debug HTML pages and snippets with a cool new web app I helped create: pagedemos.com

  3. #3
    Join Date
    Mar 2010
    ok so how do i find the values for those variables for a particular search? the browser knows what they are so there must be a way for me to get them by looking at the source code

Thread Information

Users Browsing this Thread

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

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

Recent Articles