1

How do I use jQuery to create a new window with XML content?

or to replace current XHTML window with XML window so browsers can correctly interpret it as RSS feed ?

Flow:

  1. User clicks a button to get RSS feed
  2. jQuery ajax() is used to retrieve RSS/Atom XML content
  3. RSS/Atom will be written to new browser window (and/or replace current window)

1 Answer 1

1

This could be done with Data Uri Scheme, http://en.wikipedia.org/wiki/Data_URI_scheme

But I think it is limited to some browsers.

For example, you can put this in your browsers url bar and it will render fine. the same way you could render your xml content in your new window

var u = "data:text/html;charset=utf-8,<h1>Hey thats cool</h1>";
window.open(u);
Sign up to request clarification or add additional context in comments.

3 Comments

don't really like putting it on url bar...no other way?
the contents could be Base64 encoded and you could put it into an iframe, so the new opened window with some nice url, that identifies what you need, loads jquery, the xml contents und puts them into the new opened window containing iframe.
but of course the best solution is to display the new stuff rendered by the server...

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.