Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<head>
    <meta charset="UTF-8" />
    <title>React</title>
</head>
<body>
<button id="modalLink">load data</button>
<div id="app"></div>
<script type="text/babel">
var MainBox  = React.createClass({
    render:function(){
        return(
            <App/>
        );
    }
});
var App = React.createClass ({
  getInitialState: function() {
    return { data: null };
  },
  componentDidMount: function() {
  
  $("#modalLink").click(function() {
    console.log('dffddfd');
  })
  
  console.log('fddfddf'); 
    $.get('modalcontent.php').done(function(data) {
      this.setState({data: data});
var me=this.state.data;
//alert(me);
    }.bind(this));
  },
render: function() {
  return this.state.data ?
<div dangerouslySetInnerHTML={{__html: this.state.data}} />
  : <div>Loading...</div>;
}
});
ReactDOM.render(
    <MainBox />,
    document.querySelector("#app")
);
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.7/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.7/react-dom.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.3.2/marked.min.js"></script>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers