Widgets.us.team.soccer.Comparison

A us.team.soccer.comparison brings comparison of two teams in team form, top scorers performance, squad averages (player age, height and weight), current league position and league performance stats (average goals scored per match, average goals conceded per match, conversion rate). Each team playing in the same league/tournament can be selected from a drop-down menu.

For the widget to render you need to provide one of the following parameter combinations:

  1. matchId,
  2. teamUid1, teamUid2 and seasonId,
  3. teamUid1, teamUid2 and tournamentId,
  4. teamUid1, teamUid2 and uniqueTournamentId.

new Comparison(props)

Parameters
Name Type Description
props object
Properties
Name Type Argument Default Description
matchId number

Match Id.

teamUid1 number

Unique Team Id of the first team.

teamUid2 number

Unique Team Id of the second team.

seasonId number

Season Id.

tournamentId number

Tournament Id.

uniqueTournamentId number

Unique Tournament Id.

disableWidgetHeader boolean <optional>
false

When set to true, hides widget header.

disableMatchHeader boolean <optional>
false

When set to true, hides match header.

disableTeamInfoAverages boolean <optional>
false

When set to true, hides team info averages.

disableTopScorer boolean <optional>
false

When set to true, hides top scorer.

disableSquadAverages boolean <optional>
false

When set to true, hides squad averages.

disableTeamSelector boolean <optional>
false

When set to true, hides drop-down menu for team selection.

hideNoDataErrors boolean <optional>
true

When set to true, hides partial no data errors if they exists.

border boolean <optional>

When set to true, draws border around widget.

onItemClick function <optional>

Function/event handler. Emits playerId on click or touch.

Examples

HTML/Declarative

<div class="sr-widget" data-sr-widget="us.team.soccer.comparison" data-sr-match-id="20134171"></div>
<script type="application/javascript" src="https://widgets.media.sportradar.com/uscommon/widgetloader" data-sr-language="en_us" async></script>

JS/Programmatic

<script>
    (function(a,b,c,d,e,f,g,h,i){a[e]||(i=a[e]=function(){(a[e].q=a[e].q||[]).push(arguments)},i.l=1*new Date,i.o=f,
    g=b.createElement(c),h=b.getElementsByTagName(c)[0],g.async=1,g.src=d,g.setAttribute("n",e),h.parentNode.insertBefore(g,h)
    )})(window,document,"script","https://widgets.media.sportradar.com/uscommon/widgetloader","USW", {
        language: 'en_us'
    });
    USW('addWidget', '#sr-widget', 'us.team.soccer.comparison', {matchId: 20134171});
</script>
<div id="sr-widget"></div>

JS/Example of using Event Handler

<script>
    (function(a,b,c,d,e,f,g,h,i){a[e]||(i=a[e]=function(){(a[e].q=a[e].q||[]).push(arguments)},i.l=1*new Date,i.o=f,
    g=b.createElement(c),h=b.getElementsByTagName(c)[0],g.async=1,g.src=d,g.setAttribute("n",e),h.parentNode.insertBefore(g,h)
    )})(window,document,"script","https://widgets.media.sportradar.com/uscommon/widgetloader","USW", {
        language: 'en_us'
    });
    USW('addWidget', '#sr-widget', 'us.team.soccer.comparison', {matchId: 20134171, onItemClick: function(type, obj){alert('playerId: ' + obj.playerId);}});
</script>
<div id="sr-widget"></div>