Saturday, August 20, 2016

code for pages

function addimage(source,width) {
var frame = document.getElementById("frame");var link = document.createElement("a");frame.appendChild(link)
var href = document.createAttribute("href");link.setAttributeNode("href");href.value = "url"
var imageanchor = document.createAttribute("imageanchor");link.setAttributeNode(imageanchor);imageanchor.value = 1
var image = document.createElement("img");link.appendChild(image)
var source = document.createAttribute("src");image.setAttributeNode(source)
var style = document.createElement("style");image.setAttributeNode("style");style.value = "width:" + width + "px"}

function addlink(url,color,fs,t,l) {
var frame = document.getElementById("frame");var link = document.createAttribute("a");frame.appendChild(link)
var href = document.createAttribute("href");link.setAttributeNode(href);href.value = ulr
var style = document.createAttribute("style");link.setAttributeNode("style");style.value = "color:" + color + ";font-size:" + fs
if (t === "_blank") {var tgt = document.createAttribute("target");link.setAttributeNode(tgt);tgt.value = "_blank"}
link.appendChild(document.createTextNode(l))}

function addtext(text) {document.getElementById("frame").appendChild(document.createTextNode(text))}

function clearframe() {var f = document.getElementById("frame");while (f.hasChildNodes()) {f.removeChild(f.firstChild)}}

function addnbsp() {document.getElementById("frame").appendChild(document.createTextNode("\u00A0"))

No comments:

Post a Comment