Hello everyone!
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.
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.
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...
form.html
< form id="form_login" >
Username: <input type="text" id="username"/><br>
Password: <input type="password" id="password"/><br>
<input type="button" id="button_login" value="log in" onclick="login(this)"/>
</form>
index.html
<html>
<head>
</head>
<body>
<div>
<script type="text/javascript" src="javascript.js"></script>
</div>
</body>
</html>
javascript.js
// this is where I am rendered clueless, I want my javascript to render out my form
$(#"div").html(form.html)
I am thinking that I should do a serverrequest to retrieve the form.html but I don't know how.