How to call a page in a remote site and get the result within your page with javascript

N

nabilo

I want to know if it's possible to call, within my cgi page, using
javascript, a remote url and get the result without changing my actual
page.
To say more, I have a page result appaired to the customer. And I want
to call, during this, a remote server to send the result of the
operation (ok/nok).
I don't want to use 'window.open' because it can be blocked by the
browser (pop-up).
 
J

Jim Davis

nabilo said:
I want to know if it's possible to call, within my cgi page, using
javascript, a remote url and get the result without changing my actual
page.
To say more, I have a page result appaired to the customer. And I want
to call, during this, a remote server to send the result of the
operation (ok/nok).
I don't want to use 'window.open' because it can be blocked by the
browser (pop-up).

You're mixing a lot of things together there that cloud the question. I'm
going to assume that you're talking about client-side script (not
server-side JavaScript via some CGI process).

If that's the case then, no - you can't do this in a normal application.
The browser security model will allow you to open the popup window or
include a remote page in a frame or iFrame but it will not allow script from
the two sites to "touch" one another. This would be a big (VERY BIG)
security issue. It's a no-no.

That being said you COULD access the remote site from the server-side and
pass the results to your client-side script (possibly via some AJAX-style
programming which would allow you to do this without a full-page refresh).

But there's just no way to do this, legally, with the current browser
security models (some browsers support reduced security models as options
like IE's "HTA" container... but they're not very common and would create
other issues for you).

Jim Davis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top