SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Sep 2005
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    is there a 'that' I can use instead of 'this'?

    I've been using the 'this' object function to send objects around, but how does one send the object by name?

    been using: call_javascript_function(this, 'some parameter');

    I'm trying to do something like this: call_javascript_function(documant.objectname, 'some parameter');

    thanks, i know this is easy.

  2. #2
    SitePoint Enthusiast deharocortez's Avatar
    Join Date
    Sep 2004
    Location
    Monterrey, Mexico
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The function you wrote is correct

    call_javascript_function(document.objectname, 'some parameter');

    but the "objectname" has to be defined as "id" parameter

    example :

    <div id="layer1">Some Text</div>

    is more correct to use this syntax :

    call_javascript_function(document.getElementById("layer1"), 'some parameter');
    FFCA1340CCAC3477D2D34327AC0ABB7B

  3. #3
    SitePoint Zealot
    Join Date
    Sep 2005
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    edit:

    it works. easier than I thought.

    thanks!


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
  •