•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 403,401 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,644 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1314 | Replies: 1
![]() |
Hi to all, I was wandering if I can do the following thing:
I need a page that I can input a piece of script:
e.g.
And click a button and run the script in the page.
The Script can be anything.
I found a way to insert a script in my page like
The problem is that the above piece code insert the script in the page, but doesn't run it.
I can see that the script was added, but nothing happens
Help, Thanks
I need a page that I can input a piece of script:
e.g.
<script>
function Test(mystring)
{
if (mystring !="")
alert("OK");
else
alert("NotOK");
}
</script>And click a button and run the script in the page.
The Script can be anything.
I found a way to insert a script in my page like
//mydiv is the place were I want to inser the page
var ni = document.getElementById('myDiv');
//create script object
var element = document.createElement('script');
//set attribute src with the script I insert
element.setAttribute("src",strScript);
ni.appendChild(element);The problem is that the above piece code insert the script in the page, but doesn't run it.
I can see that the script was added, but nothing happens
Help, Thanks
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
ajax asp cross-browser javascript menu with few lines of code developer development firefox home html internet javascript javascript smooth scrolling scroll smoothly window document position javascript tab menu with rounded corners generator microsoft msdn office prevent javascript menu from getting hidden under flash movies site software sql vista web
- Previous Thread: Using XML data to link a new server
- Next Thread: settimeout exit delay


Linear Mode