untitled_7 rename
author:
contributor:
published:
updated:
source uri:
Summary
// my implementation of cross-domain POST
ui.js_to_python = function (text_to_type) {
text_to_type...
ui.js_to_python = function (text_to_type) {
text_to_type...
Content
// my implementation of cross-domain POST
ui.js_to_python = function (text_to_type) {
text_to_type = unicode.escape_str(text_to_type);
var iframe = document.createElement('iframe');
iframe.style.display='none';
document.body.appendChild(iframe);
var iframe_doc = (iframe.contentWindow || iframe.contentDocument);
// see http://xkr.us/articles/dom/iframe-document/
if (iframe_doc.document) { iframe_doc = iframe_doc.document; }
var html = [
'',
' ',
' ',
''].join('\n');
iframe_doc.write(html);
var form = iframe_doc.getElementById('the_form');
form.submit();
setTimeout( function() { $(iframe).remove(); },10);
// Safari_hack: timeout wasn't required in FF
};
ui.js_to_python = function (text_to_type) {
text_to_type = unicode.escape_str(text_to_type);
var iframe = document.createElement('iframe');
iframe.style.display='none';
document.body.appendChild(iframe);
var iframe_doc = (iframe.contentWindow || iframe.contentDocument);
// see http://xkr.us/articles/dom/iframe-document/
if (iframe_doc.document) { iframe_doc = iframe_doc.document; }
var html = [
'',
' ',
' ',
''].join('\n');
iframe_doc.write(html);
var form = iframe_doc.getElementById('the_form');
form.submit();
setTimeout( function() { $(iframe).remove(); },10);
// Safari_hack: timeout wasn't required in FF
};
Recent Discussions about untitled_7
There is no discussion about this document.
Start the Discussion »