/    Sign up×
Community /Pin to ProfileBookmark

A newbie at Javascript needs a little help.

Hey guys, first of all I want to say thank you for any help you can give.

I am trying to write a code that will allow me to pull information out of the 28th td cell on a website. This information i need to pull will be between a set of these: ‘ ‘ After I pull that information I need it to be submitted to a php website in the method of a GET, so that it is entered into a database.

I thought this might work, but it doesnt…

[code]void(parent.document.getElementsByTagName(“img”)[0].src=”http://testserver.com/test/test.php?u=”+parent.document.getElementsByTagName(“td”)[27].innerHTML.split(“‘”)[1]);void(0);parent.scroll(0,0);[/code]

What I would like is for the information to be sent like this [url]http://testserver.com/test/test.php?u=(whatever[/url] was in 28th cell between ‘ ‘ here) I would also like for this to be done so that the user doesnt see it happening…

ANy help would be awesome! Thanks.

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@TheBearMayFeb 02.2006 — Since you're using parent I'll assume you're executing this from a inside frame.... See if this will help:

<i>
</i>function grab(){
var cell=parent.document.getElementsByTagName("td")[28].innerHTML;
var startPos=cell.indexOf(""")+1;
var strLen=cell.indexOf(""",startPos)-startPos;
return cell.substr(startPos,strLen);
}
function send(cellVal){
var pWin=window.open("http://testserver.com/test/test.php?u="+cellVal, "pWin");
pWin.close();
}
&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;button onclick="send(grab())"&gt;Grab TD28&lt;/button&gt;
&lt;/body&gt;
Copy linkTweet thisAlerts:
@low0rauthorFeb 02.2006 — That didnt work. ?
Copy linkTweet thisAlerts:
@TheBearMayFeb 03.2006 — ....which part? I get what I expect when I run it. Might need a little more explanation, and/or a some code to look at from what you're working on.
Copy linkTweet thisAlerts:
@johneboyFeb 03.2006 — if the website your trying to pull from, is not your's i doubt this will work due to javascript security settings
×

Success!

Help @low0r spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.22,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...