[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

Insert JS code using JS

Asked by alcani in JScript, JavaScript, Web Languages/Standards

Tags: Javascript

Hi,
I'm looking a similar way to insert information inside a DIV tag
(like http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_22119101.html).
However instead of simple text, I would like a JS function.
PD. The attached code inserts literally the code
Thank you for you help
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
function ingreso(){
var codigo = " <script type=\"text/javascript\"> <!-- ";
codigo += " st_siteroot=\"file:///P|\"; ";
codigo += " st_jspath=\"/protocolus/menu/menu-protocolus.js\"; ";
codigo += " if(!window.location.href.indexOf(\"file:\") && st_jspath.charAt(0)==\"/\") ";
codigo += " document.write('<script type=\"text/javascript\" src=\"'+st_siteroot+st_jspath+'\"><\/script>'); ";
codigo += " else ";
codigo += " document.write('<script type=\"text/javascript\" src=\"'+st_jspath+'\"><\/script>'); ";
codigo += " //--> </script> ";
var myText = document.createTextNode(codigo);
document.getElementById("encabezado").appendChild(myText);
}
[+][-]09/25/09 09:16 AM, ID: 25424465Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]09/25/09 09:17 AM, ID: 25424470Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]09/25/09 09:18 AM, ID: 25424480Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/25/09 09:24 AM, ID: 25424515Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625