Results 1 to 3 of 3

Thread: Javascript to rewrite the function dynamically

  1. #1
    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.

  2. #2
    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);
      }

  3. #3
    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.

Similar Threads

  1. Dynamically Loading External JavaScript and CSS Files
    By Adrina_g in forum Software Development
    Replies: 5
    Last Post: 02-03-2010, 11:36 AM
  2. How to calculate value dynamically in JavaScript?
    By KAIRU26 in forum Software Development
    Replies: 5
    Last Post: 24-02-2010, 11:01 PM
  3. How to Add and Remove HTML elements Dynamically In Javascript?
    By Level8 in forum Software Development
    Replies: 5
    Last Post: 20-02-2010, 06:48 PM
  4. How to dynamically expand the javascript height?
    By Recko in forum Software Development
    Replies: 3
    Last Post: 09-07-2009, 08:19 PM
  5. How to add forms Dynamically with JavaScript
    By Neil'o in forum Software Development
    Replies: 3
    Last Post: 12-03-2009, 01:12 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,133,367.02828 seconds with 17 queries