EXTJS AJAX req on local file to return generated JSON?

4 views
Skip to first unread message

john...@bluestudios.co.uk

unread,
Jan 28, 2014, 9:00:44 PM1/28/14
to node-...@googlegroups.com
What's the best approach to load a node generated JSON file from local NW app?

If I access data/test.html from the address toolbar it generates and displays the JSON file as expected.
But when I do an AJAX request to it, it returns the source of test.html and not the JSON output?

I can setup expressJS and route it calling localhost:3000/data/test and the AJAX request will work fine but it would be better to use the above method.
Is there a way to do this or am I missing anything.

Thanks
J.

LZAntal

unread,
Jan 29, 2014, 7:15:33 PM1/29/14
to node-...@googlegroups.com
Hi,
Not sure I'm following you. You said you want to load JSON file but then you load data/test.html. Is the JSOn being generated in test.html via javascript? If so can you move that code over to your starting html file? Also you can load data/test.html into a hidden iframe and just access js in there.


Laszlo



--
You received this message because you are subscribed to the Google Groups "node-webkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-webkit...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages