...

View Full Version : GetData 'body' Question



jamesplato
02-07-2007, 12:20 PM
Simple question, I hope, but I am stumped.

here is the 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.

Kor
02-07-2007, 12:38 PM
Simple question, I hope, but I am stumped.

here is the code

| <a href="javascript: getData('demo.htm','body')" class="home">


I would rather:


<a href="javascript:void(getData('demo.htm','body'))" class="home">



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:


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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum