/    Sign up×
Community /Pin to ProfileBookmark

javascript http request could I use POST for this?

Hi all,

I am writing a gadget , learning as i go, prob not a great idea but i am enjoying the challenge…

my gadget works fine… im just looking to improve the UI/apearance.

What my gadet does is requests an external webpage, and displayes the result.

OK here is the problem… currently im useing an iframe to display the external website, as the url contains user variables USER + PASS to login to the site.
I would love to be able to parse the iframe(not possile I know….) and retrieve the direct link to one of the pictures on the page. The picture incase you are wondering is actualy my download statistics.

I have noticed that the url i login with changes slightly while loading eg. USER + PASS changes to USER&id=qwertyBLAHBLAHBLAH. A type of cookie i guess..? This is esentialy what i am trying to grab, as if i had this i could make a direct request to the image on the server I have tried lots of diffrent ways to get the new iframe .src but from what ive read this too is not possible…

So any advice would be Great!

I hope if your reading this, you understand what im trying to do.

Would xmlhttprequest using POST work? any suggestions…

Thanks in advance,
Sloppy.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@rnd_meApr 15.2009 — lots of web servers work without passing all the GET params it includes in the url.

try removing key:vals from a google search for instance, all you really need is "q".

if that's not the case, you need a server to break the domain rules...

you can't cross domains via ajax, but you can with a regular HTML form...
Copy linkTweet thisAlerts:
@sloppy_coderauthorApr 15.2009 — lots of web servers work without passing all the GET params it includes in the url.

try removing key:vals from a google search for instance, all you really need is "q".

if that's not the case, you need a server to break the domain rules...

you can't cross domains via ajax, but you can with a regular HTML form...[/QUOTE]


Hi rnd me,

thank you for the reply.

I have removed some of the get params i now know which are needed to display the image i require, but I still have the problem of the unique id/cookie in the url (this changes on every login) eg.

Url: htt ://dslstats.MYPROVIDER.com/commoncgi/dslstats/showstats.cgi?&username=MYUSERNAME&password=MYPASSWORD

once the page loads the url becomes:

htt ://dslstats.MYPROVIDER.com/commoncgi/dslstats/showstats.cgi?&username=MYUSERNAME&sid=GXeuR5NCClq6QgbmdCmJFUvGQxrrJG

"&sid=GXeuR5NCClq6QgbmdCmJFUvGQxrrJG" is what i need but how to capture this i have no idea

if i could get the url... or even the loged in wepage using ajax i could parse the responseText for this unique id

This was why i was wondering if i used ajax POST to send the form details would it return the loged in webpage?

If im not making sence or im not understanding you please let me know..
Copy linkTweet thisAlerts:
@rnd_meApr 16.2009 — i understand what you are trying to do, but as you are finding out, I don't think it can be done.
×

Success!

Help @sloppy_coder 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 6.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...