0

Say I there's mypage.html and otherpage.html

otherpage.html has some content <p>content is content</p>

I want a javascript that can fetch the content from otherpage.html and paste it in mypage.html

Is there a javascript that can accomplish this? thanks.

1
  • You're looking for AJAX and HTML parsing. It's trivial with jQuery. Commented Feb 1, 2012 at 1:50

1 Answer 1

3

From the title, it appears that otherpage.html is in a different domain. This being the case this is not possible in the browser (there's a few exceptions with flash/java/silverlight). If the page is in the same domain, it's easy. Take a look at jQuery.get.

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

1 Comment

I think it is useful to at least provide a link to explain the same origin policy: en.wikipedia.org/wiki/Same_origin_policy

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.