4

Hi I am quite new to java script and i am looking a working example to call back ends using java script channel API . I do not have any idea about channel API . Can anyone provide me a working example

1
  • Sorry, I voted to close this before I saw the reference to backends. My apologies. Commented Nov 28, 2011 at 17:51

2 Answers 2

3

If you're asking how to get a message from the backend to a javascript client: you can't send messages from a backend server to a channel created on a frontend server. This is because the app version number is included in the channel token, and backends have a different app version than frontends. You could, however, implement a servlet in your backend that calls createChannel and returns it to your frontend for inclusion in javascript that your frontend renders.

If you're trying to send a message to a backend from your javascript code, you won't be able to use XmlHttpRequest directly because of the same-origin policy (this assumes your clients are rendered from a non-backend instance). You could get around this using JSONP, or by routing XHR requests from your frontend to your backend in a frontend servlet.

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

2 Comments

I have a back end handler which fetch URLs . I am looking a way to call it via an ajax Handler. That is my goal
and i am looking for a python example
2

Did you see the docs? Java / Python

3 Comments

Im Using python not java . it didnt specify anything about backend urls though used URL;s
@pradeek the site you mentioned is "a protected blog" and I don't want to login to wordpress.

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.