I use this code to send information to a NODEjs server :
var obj=new XMLHttpRequest();
vat txt2send = "test";
obj.open("GET","http://localhost:1234" + "?variable=" + txt2send, true);
obj.send(null);
But now i would like to send an html code. Example :
var txt2send = '<div class="generate_div_last">
<h3>Sentences:</h3>
<form id="sent" name="sent" method="post" action="http://www.ipsum-generator.com/loremipsum/sentences">
<input type="text" id="numsent" name="num" size="2" maxlength="3" value="50" />
<input type="submit" id="poslji3" class="poslji" name="poslji" value="Generate!" />
<h4>Options:</h4>
<input type="checkbox" id="p_tags_sent" name="p_tags" />
<span class="tiny2">
<label for="p_tags_sent">Add paragraph tags (<p>)</label>
</span><br />
<input type="checkbox" id="i_tags_sent" name="i_tags" />
<span class="tiny2">
<label for="i_tags_sent">Add <i>italic</i> tags (<i>)</label>
</span><br />
<input type="checkbox" id="b_tags_sent" name="b_tags" />
<span class="tiny2">
<label for="b_tags_sent">Add <b>bold</b> tags (<b>)</label>
</span><br />
</form>
<div class="small">This option will generate the specified number of sentences of lorem ipsum.</div>
</div>';
How can i achieve that ? Now of course i have a malformed URL.