Re: [b]First of all, please familiarize yourself with all the codes & take note of the difference between css & js.[/b]
The topic here is about compiling js so don't be asking about css considered only if
somebody can help me??
if i want to compiling 2 or 3 scripts to 1 js 4 linker,
example:
scripts 1
[quote]if (typeof CFNAMES == "undefined") { CFNAMES = {}; }
CFNAMES = {
getData: null,
sibling: null,
init: function() {
CFNAMES.getData = document.createElement("ul");
CFNAMES.getData.setAttribute("class","data");
CFNAMES.getData.innerHTML = "<li><span class=\"q\">YOUR TEXT</span></li>"+
"<li><span class=\"q\">YOUR TEXT</span></li>"+
"<li><span class=\"q\">YOUR TEXT</span></li>"+
"<li><span class=\"q\">YOUR TEXT</span></li>"+
"<li><span class=\"q\">YOUR TEXT</span></li>"+
"<li><span class=\"q\">YOUR TEXT</span></li>"+
"<li><span class=\"q\">YOUR TEXT</span>"+
"<a style=\"font-weight: normal;\" href=\"/YOUR TEXT\">YOUR TEXT</a></li>";
CFNAMES.sibling = CFNAMES.getElementsByClassName(document.getElementById("content_0"),"ul","data")[0];
CFNAMES.sibling.parentNode.replaceChild(CFNAMES.getData,CFNAMES.sibling);
},
getElementsByClassName: function(oElm,sTag,sClass) {
var elm = [];
if (!oElm)oElm = document;
if (!sTag)sTag = "*";
var els = oElm.getElementsByTagName(sTag) || document.all;
for (var i=0,j=els.length;i<j;i++) {
if (new RegExp(sClass).test(els[i].className))elm.push(els[i]);
}
return elm;
}
};CFNAMES.init();[/quote]
scripts 2
[quote]if (typeof MOREABOUT == "undefined") { MOREABOUT = {}; }
MOREABOUT = {
getElements: null,
elements: {
mainid: document.getElementById("content_6"),
maintag: "span",
mainclass: "q"
},
init: function() {
try {
MOREABOUT.getElements = MOREABOUT.getElementsByClassName(MOREABOUT.elements.mainid,MOREABOUT.elements.maintag,MOREABOUT.elements.mainclass);
MOREABOUT.getElements[0].innerHTML = "YOUR TEXT OR IMAGE";
MOREABOUT.getElements[1].innerHTML = "YOUR TEXT OR IMAGE";
MOREABOUT.getElements[2].innerHTML = "YOUR TEXT OR IMAGE";
MOREABOUT.getElements[3].innerHTML = "YOUR TEXT OR IMAGE";
MOREABOUT.getElements[4].innerHTML = "YOUR TEXT OR IMAGE";
}catch(e) {
MOREABOUT.getElements = "";
}
},
getElementsByClassName: function(oElm,sTag,sClass) {
var elm = [];
if (!oElm)oElm = document;
if (!sTag)sTag = "*";
var els = oElm.getElementsByTagName(sTag) || document.all;
for (var i=0,j=els.length;i<j;i++) {
if (new RegExp(sClass).test(els[i].className))elm.push(els[i]);
}
return elm;
}
};MOREABOUT.init();[/quote]
then, what should i do??
how about this:
after compiling:
[quote][b]//scripts 1[/b]
if (typeof CFNAMES == "undefined") { CFNAMES = {}; }
CFNAMES = {
getData: null,
sibling: null,
init: function() {
CFNAMES.getData = document.createElement("ul");
CFNAMES.getData.setAttribute("class","data");
CFNAMES.getData.innerHTML = "<li><span class=\"q\">YOUR TEXT</span></li>"+
"<li><span class=\"q\">YOUR TEXT</span></li>"+
"<li><span class=\"q\">YOUR TEXT</span></li>"+
"<li><span class=\"q\">YOUR TEXT</span></li>"+
"<li><span class=\"q\">YOUR TEXT</span></li>"+
"<li><span class=\"q\">YOUR TEXT</span></li>"+
"<li><span class=\"q\">YOUR TEXT</span>"+
"<a style=\"font-weight: normal;\" href=\"/YOUR TEXT\">YOUR TEXT</a></li>";
CFNAMES.sibling = CFNAMES.getElementsByClassName(document.getElementById("content_0"),"ul","data")[0];
CFNAMES.sibling.parentNode.replaceChild(CFNAMES.getData,CFNAMES.sibling);
},
getElementsByClassName: function(oElm,sTag,sClass) {
var elm = [];
if (!oElm)oElm = document;
if (!sTag)sTag = "*";
var els = oElm.getElementsByTagName(sTag) || document.all;
for (var i=0,j=els.length;i<j;i++) {
if (new RegExp(sClass).test(els[i].className))elm.push(els[i]);
}
return elm;
}
};CFNAMES.init();
[b]//scripts 2[/b]
if (typeof MOREABOUT == "undefined") { MOREABOUT = {}; }
MOREABOUT = {
getElements: null,
elements: {
mainid: document.getElementById("content_6"),
maintag: "span",
mainclass: "q"
},
init: function() {
try {
MOREABOUT.getElements = MOREABOUT.getElementsByClassName(MOREABOUT.elements.mainid,MOREABOUT.elements.maintag,MOREABOUT.elements.mainclass);
MOREABOUT.getElements[0].innerHTML = "YOUR TEXT OR IMAGE";
MOREABOUT.getElements[1].innerHTML = "YOUR TEXT OR IMAGE";
MOREABOUT.getElements[2].innerHTML = "YOUR TEXT OR IMAGE";
MOREABOUT.getElements[3].innerHTML = "YOUR TEXT OR IMAGE";
MOREABOUT.getElements[4].innerHTML = "YOUR TEXT OR IMAGE";
}catch(e) {
MOREABOUT.getElements = "";
}
},
getElementsByClassName: function(oElm,sTag,sClass) {
var elm = [];
if (!oElm)oElm = document;
if (!sTag)sTag = "*";
var els = oElm.getElementsByTagName(sTag) || document.all;
for (var i=0,j=els.length;i<j;i++) {
if (new RegExp(sClass).test(els[i].className))elm.push(els[i]);
}
return elm;
}
};MOREABOUT.init();[/quote]
[b]is'nt right???[/b]
thx 4 help.