0

I have a html page on a web server (it's a remote outlet programmable via LAN) with a js script included. I need to execute a function declared on this .js from a remote server php's page. I cannot understand how to do and if it's possible. thank you roberto

3
  • One way I can think of is using WebSockets. Commented Jan 15, 2015 at 17:33
  • Simple AJAX calls will likely solve your problem. If you need to go cross-domain, use CORS. Commented Jan 15, 2015 at 17:34
  • Hi,thank you for fast reply. I'm not very skilled could you please give me an example of that? Commented Jan 15, 2015 at 17:50

2 Answers 2

1

I believe it is not allowed because of the security issue. You can see what is possible here: http://jquery-howto.blogspot.com/2013/09/jquery-cross-domain-ajax-request.html

Sign up to request clarification or add additional context in comments.

Comments

0

You can use an iFrame.

When your user opens the php page, it will contain an iframe that opens the html page of the other web server.

Here's a stackoverflow question that answers how to do that Invoking JavaScript code in an iframe from the parent page

if you don't want the iframe to be visible you can hide with CSS.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.