Score
us.match.ncaab.score is a variant of the smaller scoreboard with links. It features the current score, the teams represented by name and logo, the game status, and other key game-related information as collapsible content.
For the widget to render you must provide a valid matchId
. All other properties are optional.
Parameters
Name | Type | Description | ||||
---|---|---|---|---|---|---|
props |
object | properties | ||||
Name | Type | Argument | Default | Description | ||
matchId |
number | required | Match ID | |||
showDate |
boolean | optional | If true shows the scheduled date beside the time (pre-game only). |
|||
isCollapsed |
boolean | optional | 'true' | If false collapses collapsible content (i.e. game information). |
||
showOdds |
boolean | optional | 'true' | If false hides odds (pre-game only). |
||
disableHeader |
boolean | optional | If true hides the header. |
|||
disableGameInfo |
boolean | optional | If true hides collapsible content (i.e. game information). |
|||
disableGameInfoXSmall |
function | optional | If true hides collapsible content (i.e. game information) on X-Small responsive breakpoint (<321px). |
|||
disableAttendance |
boolean | optional | If true hides attendance content. |
|||
disableTeamClick |
boolean | optional | If true disables onItemClick handler for teams. |
|||
disablePlayerClick |
boolean | optional | If true disables onItemClick handler for players (i.e. team leaders under game information). |
|||
enableMatchClick |
boolean | optional | If true the whole widget triggers match target event on onItemClick. All other targets are disabled. |
|||
preMatchLinks |
string | optional | Comma separated string of link keys for pre-game. Can be undefined , default , preview , boxscore , gametracker , recap , lineups , matchstats . Entering default is the same as entering 'preview' . |
|||
liveMatchLinks |
string | optional | Comma separated string of link keys for a live game. Can be undefined , default , preview , boxscore , gametracker , recap , lineups , matchstats . Entering default is the same as entering 'boxscore, gametracker' . |
|||
postMatchLinks |
string | optional | Comma separated string of link keys for post-game. Can be undefined , default , preview , boxscore , gametracker , recap , lineups , matchstats . Entering default is the same as entering 'boxscore, recap' . |
|||
border |
boolean | optional | 'true' | If false hides a border around the widget. |
||
onItemClick |
function | optional | Function/event handler. More info below. |
By default, the widget has two click target areas: team
and player
.
The player
targets appear in the Game Information section depending on the game status. With preMatchLinks
, liveMatchLinks
and/or postMatchLinks
enabled, the Score widget can get additional targets: preview
, boxscore
, gametracker
, recap
, lineups
, and matchstats
.
When enableMatchClick
is set to true the whole Score widget becomes a match target and all other targets are disabled.
All targets emit the following match props on click or touch: matchId
, sportId
, realCategoryId
, seasonId
, tournamentId
, uniqueTournamentId
, awayTeamUid
, homeTeamUid
, matchStatus
.
Team target adds uniqueTeamId
; player target adds playerId
.
Valid matchStatus
values are: pre
, live
, post
.
Examples
<div class="sr-widget" data-sr-widget="us.match.ncaab.score" data-sr-match-id="19970966"></div>
<script type="application/javascript" src="https://widgets.media.sportradar.com/YOUR_CLIENT_ALIAS/widgetloader" data-sr-language="en_us" async></script>
<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/YOUR_CLIENT_ALIAS/widgetloader","SIR", {
language: 'en_us'
});
SIR('addWidget', '#sr-widget', 'us.match.ncaab.score', {matchId: 19870908});
</script>
<div id="sr-widget"></div>
<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/YOUR_CLIENT_ALIAS/widgetloader","SIR", {
language: 'en_us'
});
SIR('addWidget', '#sr-widget', 'us.match.ncaab.score', {matchId: 14224723, postMatchLinks: 'default', onItemClick: function(target, obj){alert(target+':'+JSON.stringify(obj));}});
</script>
<div id="sr-widget"></div>
"team",{"matchId":26536476,"seasonId":76813,"tournamentId":79167,"uniqueTournamentId":28370,"realCategoryId":15,"sportId":2,"awayTeamUid":34626,"homeTeamUid":66366,"matchStatus":"post","uniqueTeamId":34626}
"box_score",{"matchId":26536476,"seasonId":76813,"tournamentId":79167,"uniqueTournamentId":28370,"realCategoryId":15,"sportId":2,"awayTeamUid":34626,"homeTeamUid":66366,"matchStatus":"post"}
"box_score",{"matchId":27515036,"seasonId":79153,"tournamentId":10561,"uniqueTournamentId":132,"realCategoryId":15,"sportId":2,"awayTeamUid":3416,"homeTeamUid":3427,"matchStatus":"post"},
"match",{"matchId":26536476,"seasonId":76813,"tournamentId":79167,"uniqueTournamentId":28370,"realCategoryId":15,"sportId":2,"awayTeamUid":34626,"homeTeamUid":66366,"matchStatus":"post"}
Updated over 1 year ago