title: insert external html
body: <p>I am just learning to create websites and I have been programmming a lot of OOB languages before so I am kind of used to write small objects and just paste them where I want them.</p>
  
  <p>I would like to know if there is a way to create for instace a login form och what ever piece of html that you use regulare on sites and save that to a file, html or xml and then with the help of javascript add this form onto your main site.</p>
  
  <p>I will try to make an example to clearify what I want to do, it's the javascript that I do not know how to write...</p>
  
  <p>form.html</p>
  
  <pre><code>&lt; form id="form_login" &gt;
  Username: &lt;input type="text" id="username"/&gt;&lt;br&gt;
  Password: &lt;input type="password" id="password"/&gt;&lt;br&gt;
  &lt;input type="button" id="button_login" value="log in" onclick="login(this)"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>index.html</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div&gt;
  
  &lt;script type="text/javascript" src="javascript.js"&gt;&lt;/script&gt;
  
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>javascript.js</p>
  
  <pre><code>// this is where I am rendered clueless, I want my javascript to render out my form
  $(#"div").html(form.html)
  </code></pre>
  
  <p>I am thinking that I should do a serverrequest to retrieve the form.html but I don't know how.</p>