Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    GetData 'body' Question

    Simple question, I hope, but I am stumped.

    here is the code
    Code:
    | <a href="javascript: getData('demo.htm','body')" class="home">
    now on the page demo.htm, the text will show on index.htm, or a picture (if I call it via img src), but if I have any javascript scripts it will show nothing--not even text. I know 'body' will give me the items/text in the body, but I assume body needs to be replaced with something else to get the srcipt to run. I just have no idea? Any options. I would like to keep the way the page is being calle dinto the frame, I just would like to add some functionality.

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Quote Originally Posted by jamesplato View Post
    Simple question, I hope, but I am stumped.

    here is the code
    Code:
    | <a href="javascript: getData('demo.htm','body')" class="home">
    I would rather:
    Code:
    <a href="javascript:void(getData('demo.htm','body'))" class="home">
    Quote Originally Posted by jamesplato View Post
    I know 'body' will give me the items/text in the body,
    Really? as the codes looks like, 'body' will give you nothing, as it is a simple string. It might help you to return the content of the body, but only if the getData() function would have something like:
    Code:
    function getData(url,tag){
    alert(document.getElementsByTagName(tag)[0].innerHTML)
    }
    By the way, show us your code and tell us precisely what is wrong with it.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

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