JSFiddle - React, Tailwind, and code Playground

by santeriv

HTML

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css">
<script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>
<div data-role="page" id="some">
  <div data-role="header">
      <h3>I need this</h3>
  </div>
  <div data-role="content">
      Page 1
  </div>
  <div id="fetched-output">
      
  </div>
  <div data-role="footer">
      Footer
  </div>
</div>

JavaScript

/*
* Try url http://www.pulljson.com/jquery?site=http://jquerymobile.com/demos/1.2.1/docs/pages/multipage-template.html&selector=find('%23two').children('div').children('p')&callback=?
*/
$('#fetched-output').show();
	$.ajax(
	{
		dataType:'jsonp',
		url:"http://www.pulljson.com/jquery?site=http://jquerymobile.com/demos/1.2.1/docs/pages/multipage-template.html&selector=find('%23two').children('div').children('p')&callback=?",
        /*
        the selector api,node req.url, cannot currently handle hash in the middle of
        URL query part #two thus you need to encode it yourself with %23two
        */
		success:function(data) {
			var items = [];
			/*Puts into list of buttons found texts*/
			$.each(data.results, function(key, val) {
				/* val.text refers to content of tags */
                items.push('<li id="fetched-item-' + key + '"><input type="button" value="'+ (val.text ? val.text : val.A.text ) + '"/></li>');
			});
			$('<ul />', {
				'id': 'items',
				'html': items.join('')
			}).appendTo('#fetched-output');
		}
	});