Your comments

$.getJSON is working, silly me; however, general XMLHttpRequest still does not work due to the same origin restriction. For example, to make edits to a remote couchdb.  The window.create & bSave function did not work in MobileSafari or Nocs.

var host = "";
var dbname= "super"
window.create = function(dbname) {
return $.ajax({
type: "PUT",
url: "" + + "/" + dbname,
success: function(json) {
return alert(JSON.stringify(json), {
error: (function(XMLHttpRequest, textStatus, errorThrown) {
return alert("XMLHttpRequest: " + XMLHttpRequest + "\nTextStatus : " + textStatus + "\nError Thrown: " + errorThrown);

var bSave = function (dbname, jsonTable) {
xhr = new XMLHttpRequest();"POST", host + dbname + '/_bulk_docs');
xhr.setRequestHeader('Content-Type', 'application/json');

Thanks Alex; I simply assumed, as it doesn't work on Windows without serious modifications & it is not an advertised feature of textastic to have disabled the same-origin policy (perhaps I missed it). I use markdown combined with jQuery to produce statistical reports. 

Here is a simplest example of the kind of code I want to be able to use:

<script type="text/javascript" src=""> </script>
<div id="test"></div>
<div id="test2"></div>
<script type="text/javascript">

", function(x) { $("#test").html("<pre>" + JSON.stringify(x) + "</pre>"); });

$.getJSON("", function(x) { $("#test2").html("<pre>" + JSON.stringify(x) + "</pre>"); });


Also, the ability to export the Preview in PDF would be helpful, as this is taken for granted on a PC, not sure if this is possible in Textastic.

P.S. I just tested this code on the free Nocs markdown editor and it seems to WORK!! shocking ...  they offer exporting the HTML but does not offer exporting PDF, which is a shame as the HTML does not render properly on PC and the eventual purpose is to be able to print out the view to share with others in a meeting.

An alternative to having an HTTP proxy working inside Textastic, is to have a custom markdown directive to download the data needed to the local file system, where the markdown preview webkit engine can access.

I use markdown combined with HTML/js to render data & content loaded dynamically from other sites. Currently I use the pagedown web app for markdown, and this can be done easily by proxying AJAX requests to a remote couchdb server using node.js; however, on textastic, that is not possible due to cross-domain restrictions, what would be amazing is to have HTTP proxy is working inside Textastic to allow for cross-domain XMLHttpRequest Calls, then I would certainly buy the app.