paperlined.org
apps > bookmarklets > html > app_specific > small_diff
document updated 19 years ago, on Nov 25, 2005
drag_and_rename (465 characters)



// Upload the HTML associated with the selection to a CGI script.
//
//

void(q = '');
void(l = '');

// When no frames
f = document.frames;
if (f.length == 0)
{
	q = document.selection.createRange().htmlText;
	l = document.location;
}

// When there are frames
for (i=0; i<f.length; i++)
{
	d = f[i].document;
	q =                           d.selection.createRange().htmlText;
	l =                           d.location;
	if (q != '')
		break;
}

// Display the results
if (q)
{
	//alert(q);
	d = window.open('about:blank', '').document;
	//d.write(q);
	d.writeln('<FORM METHOD=POST ACTION=http://68k.org/cgi-bin/cgiwrap/interiot/receive_img>'
		+ '<INPUT TYPE=HIDDEN NAME=content>'
		+ '<INPUT TYPE=HIDDEN NAME=base_href></FORM>');

	alert('hi');
}