<commit_before>---
layout: page
title: Card Refresh Plugin
---

The card refresh plugin provides the functionality for loading ajax content into the card. 

##### Usage

This plugin can be activated as a jQuery plugin or using the data API. 

###### Data API
{: .text-bold }

Activate the plugin by adding a button with `data-card-widget="card-refresh"` to the card and provide the required `data-source="/URL-TO-CONTENT"` option. By doing that, the plugin will automatically create a GET request to the provided URL and render the returned response the `.card-body` section of the card. If you need to process the returned response before rendering, you should use the jQuery API, which provides hooks to deal with the response. 


###### jQuery
{: .text-bold }

The jQuery API provides more customizable options that allows the developer to pre-process the request before rendering and post-process it after rendering. 

```js
('#my-card [data-card-widget="card-refresh"]').CardRefresh(options)
```

##### Options
{: .mt-4}

|---
| Name | Type | Default | Description
|-|-|-|-
| source | String | '' | The URL to the source.<commit_msg>docs(card-refresh): add missing $ in example<commit_after>---
layout: page
title: Card Refresh Plugin
---

The card refresh plugin provides the functionality for loading ajax content into the card. 

##### Usage

This plugin can be activated as a jQuery plugin or using the data API. 

###### Data API
{: .text-bold }

Activate the plugin by adding a button with `data-card-widget="card-refresh"` to the card and provide the required `data-source="/URL-TO-CONTENT"` option. By doing that, the plugin will automatically create a GET request to the provided URL and render the returned response the `.card-body` section of the card. If you need to process the returned response before rendering, you should use the jQuery API, which provides hooks to deal with the response. 


###### jQuery
{: .text-bold }

The jQuery API provides more customizable options that allows the developer to pre-process the request before rendering and post-process it after rendering. 

```js
$('#my-card [data-card-widget="card-refresh"]').CardRefresh(options)
```

##### Options
{: .mt-4}

|---
| Name | Type | Default | Description
|-|-|-|-
| source | String | '' | The URL to the source.
{'fraction_non_alphanumeric': 0.11178509532062392, 'fraction_numerical': 0.0008665511265164644, 'mean_word_length': 4.052516411378556, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1858783', 'n_tokens_mistral': 628, 'n_tokens_neox': 594, 'n_words': 297}