1

my problem is that I want to get access from page index1.html to object in page index2.html, for example:

<button id="btnIndex1" onclick="$('#PopUpDIvIdInPageIndex2').show();">btn in index1.html</button>

Solutions with coockies and another storages are not useful for me because I need immediately(real-time) access. Any suggestions?

2 Answers 2

1

You can't just reference an element on another page. What would happen if you could just inject some code this way in a div on the open Facebook page from a user? That wouldn't be nice, huh.

The option you have in my opinion to make this semi-real-time is by using WebSockets. From page 1, send a request to the server. The server will send a request to page 2 to update something.

To learn more about WebSockets, read this tutorial on HTML5 Rocks.

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

Comments

0

For a simple task to load a page from a click event I would instead suggest an ajax-request.

This could simply be done with the javascript library jquery.

http://jquery.com/

Have a look at the jquery load method

http://api.jquery.com/load/

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.