SkillAgentSearch skills...

Tracker

this is a javascript error tracker

Install / Use

/learn @victor0210/Tracker
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Tracker.js

tracker.js is a samll component for uploading front-end-error.

Usage

First import tracker.js to head

<head>
	<script src="tracker.js" type="text/javascript"></script>
</head>

Then init tracker instance in the front of all script

<script>
	ErrorTracker.init(opts);
</script>

Options

Options is a json object with these params configuration

params | type | default | description ---- | --- | --- | --- report_url | String | null | report request server url method | String | post | report request method headers | Object | { 'Content-Type':'application/json' } | request headers callbackSuccess | Function | null | callback after upload success callbackFailed | Function | null | callback after upload fail

Enjoy

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Tracker.js</title>
    <script src="tracker.js" type="text/javascript"></script>
</head>
<body>
<script>
    ErrorTracker.init({
        report_url: 'http://www.abc.com'
    });

    var f = window.testErrorTracker();
</script>
</body>
</html>

Related Skills

View on GitHub
GitHub Stars56
CategoryDevelopment
Updated5y ago
Forks3

Languages

JavaScript

Security Score

80/100

Audited on Sep 17, 2020

No findings