0

I am building a web application that's purely dependent on services. so, the client side code is purely html, javascript/jQuery which calls some REST services to render UI. i would need to pass a jSON object from one html page to other html page. The target html page will need to open in new window..

Is there an easy & efficient way to accomplish the same?

I am reading through backbone routers etc..., but was wondering if that's an overkill. please advice.

Few considerations:

need a cross browser (if not really old browsers) solution and can not pass as part of query string. as this will be quite big

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
nodeuser
  • 235
  • 4
  • 9
  • Please post your code so far, it is not clear what you're asking exactly. Have you tried localstorage or cookies? – elclanrs Oct 05 '13 at 23:02
  • Have you considered a client side framework like Ember.js, Backbone.js or Angular? – Jon Koops Oct 05 '13 at 23:08
  • I would try to use the way explained here: http://stackoverflow.com/questions/10732065/send-data-to-seperate-window-javascript – mjb4 Oct 06 '13 at 00:04

2 Answers2

0

If you cannot pass as part of a query string, then you will need some sort of back end to your application. One suitable candidate would be Firebase (a back-end service that has free options). This is particular useful to you since your application seems to be front end heavy.

Conqueror
  • 4,265
  • 7
  • 35
  • 41
0

Ok just so the answer is clear:

// Your /main.html file
<script type="text/javascript">
    w = window.open("/other.html", "WindowTitle");

    function getJSON(){
        return my_json_data;
    }
</script>

// Your /other.html file
<script type="text/javascript">
    // Get Json Data
   my_json_data = window.opener.getJSON();
</script>
mjb4
  • 989
  • 1
  • 9
  • 14