@@ -64,7 +64,7 @@ document.loadWidget({
6464Within the ` <body> ` tag add the instanceId div wherever you want this widget to render.
6565
6666``` html
67- <div id =" example-widget-1" data-attr =" foobar" ></div >
67+ <div id =" example-widget-1" data-button-text =" foobar" ></div >
6868```
6969
7070- [ See an example] ( https://github.com/js-widgets/example-widget/blob/master/src/public/index.html#L79 ) of the widget placement implementation.
@@ -85,8 +85,8 @@ document.loadWidgets({
8585```
8686
8787``` html
88- <div id =" example-widget-1" data-attr =" foo" ></div >
89- <div id =" example-widget-2" data-attr =" bar" ></div >
88+ <div id =" example-widget-1" data-button-text =" foo" ></div >
89+ <div id =" example-widget-2" data-button-text =" bar" ></div >
9090```
9191
9292#### Parameters
@@ -109,7 +109,7 @@ import React, { Component } from 'react';
109109class Widget extends Component {
110110 render () {
111111 return (
112- < div className= " App" > {this .props .obj .getAttribute (' data-attr ' )}< / div>
112+ < div className= " App" > {this .props .obj .getAttribute (' data-button-text ' )}< / div>
113113 );
114114 }
115115}
@@ -122,15 +122,15 @@ export default Widget;
122122#### DIV attributes
123123
124124``` html
125- <div id =" example-widget-1" data-attr =" Hello world!" ></div >
125+ <div id =" example-widget-1" data-button-text =" Hello world!" ></div >
126126```
127127
128128- [ See an example] ( https://github.com/js-widgets/example-widget/blob/master/src/public/index.html#L79 ) of the widget attribute implementation.
129129
130130#### Query string values
131131
132132```
133- http://localhost:3000/?data-attr =Hello%20world!
133+ http://localhost:3000/?data-button-text =Hello%20world!
134134```
135135
136136Note: DIV attributes are the preferred method and will always take precedence over the use of query
0 commit comments