www.webdeveloper.com
Results 1 to 2 of 2

Thread: sending id to js function

  1. #1
    Join Date
    Jul 2004
    Posts
    18

    sending id to js function

    Hi all i am using this function for open/close folder

    function NodeProcessing(divNum,TmpId){

    if (divNum == 0)
    {
    var txt = document.getElementById('a2').innerHTML


    document.getElementById('a2').innerHTML = (txt=='Show All Sub') ? "Hide All Sub" : "Show All Sub"
    }

    and when i am calling this function by:

    <a href="#" onclick="NodeProcessingYanuv(0,{generate-id(.)})" id="a2">Show All Sub</a>

    this static code works fine but when ever i try to change the code to a dynamic way like that :

    function NodeProcessingYanuv(divNum,TmpId){
    if (divNum == 0)
    {
    var txt = document.getElementById(TmpId).innerHTML
    document.getElementById(TmpId).innerHTML = (txt=='Show All Sub') ? "Hide All Sub" : "Show All Sub"
    }

    and i an calling this function by:

    <a href="#" onclick="NodeProcessingYanuv(0,{generate-id(.)})" id="{generate-id(.)}">Show All Sub</a>

    It is not working, and the debbuger say that an object is needed

    way the id="{generate-id(.)}" dont work like id="a0"> ?

    can anyone help please ?

  2. #2
    Join Date
    Jan 2004
    Location
    Washington DC
    Posts
    1,107
    Are you trying to simply display the page in a browser? generate-id() is an XSLT function, not an XML function.
    Bittersweet web development.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles