Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 18-06-2009
Member
 
Join Date: Apr 2008
Posts: 32
Javascript to rewrite the function dynamically

Hi.

I want to know How is this possible to do?
I want to know how can I change the specific dive id tag in my HTML file using the javascript? This should rewrite the function dynamically.
Thanks in advance.
Reply With Quote
  #2  
Old 18-06-2009
Member
 
Join Date: May 2008
Posts: 29
Re: Javascript to rewrite the function dynamically

JavaScript is a dynamic language. A *very* dynamic language. You can do anything, any time.

Here is some example code I've found... does anyone have a better way?

Code:
function include(url)
  {
    var s = document.createElement("script");
    s.setAttribute("type", "text/javascript");
    s.setAttribute("src", url);
    var nodes = document.getElementsByTagName("*");
    var node = nodes[nodes.length -1].parentNode;
    node.appendChild(s);
  }
Reply With Quote
  #3  
Old 18-06-2009
Member
 
Join Date: May 2008
Posts: 30
Re: Javascript to rewrite the function dynamically

Code:
[source:javascript]
function parent() {
function child() {
alert(”Child function called”);
}

// Assign the function to a variable
var childFunction = child;

childFunction();
}

parent();
[/source]
Executing above code will alert “Child function called”. So, javascript also creates a variable called child.

To know Javascript in detail.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Javascript to rewrite the function dynamically"
Thread Thread Starter Forum Replies Last Post
Dynamically Loading External JavaScript and CSS Files Adrina_g Software Development 5 02-03-2010 11:36 AM
How to calculate value dynamically in JavaScript? KAIRU26 Software Development 5 24-02-2010 11:01 PM
How to Add and Remove HTML elements Dynamically In Javascript? Level8 Software Development 5 20-02-2010 06:48 PM
How to dynamically expand the javascript height? Recko Software Development 3 09-07-2009 08:19 PM
How to add forms Dynamically with JavaScript Neil'o Software Development 3 12-03-2009 01:12 PM


All times are GMT +5.5. The time now is 11:48 PM.