0

I am trying to do a choice provider. which will take a (choice) program with n number of choices

For example :

Lets say wanted to make a coffee have to choices-
1. < light, dark>
2. < with sugar , without sugar>
( i know its a bad example)
Then my program should make four new routes/tabs and should open four tabs having
1. light coffee with sugar..
2. light coffee without sugar...
3 and 4 with dark.

Tabs are considered to show those are four different things that came from single source file (which supposed to be a c program,explained with coffee here)

I know opening a new tab can be done using

button(type="button", onclick="window.open('auth/google', '_blank');")

To sum up all my question is
"Giving a text/program having choices should create and open up all possible choices as new tabs." (1.In a same window, like ext js calender application with day weeks months tabs, but I heard there is no way for that in node.js,correct me if I am wrong. or 2. as Separate window tabs)

P.S: new to node.js no harsh comments please. any link that can infer my doubts appreciated

Panini
  • 91
  • 6
  • Why not just do multiple `window.open();` in the same `onclick` event? – ctwheels Aug 15 '14 at 20:38
  • I need to know how to create n number of tabs from the text/program given first. then need to open by referring them though.. which needs automatic indexing of tabs like c1,c2,... depending on choices and their possibilities. – Panini Aug 15 '14 at 20:45
  • What do you mean from the text/program first, could you expand on that? Also, by the automatic indexing of tabs, you mean that there are multiple pages, all using the same link format, except you add an index number at the end? Could you give a couple sample urls for what you're looking for – ctwheels Aug 16 '14 at 00:06
  • consider a text like ` coffee ` is given in a text box which will produce four tabs like /c1 /c2 /c3 /c4 with four possible coffees that can be made with the text box input by an event,clicking on a buttton. – Panini Aug 16 '14 at 00:11

1 Answers1

1

I dont know if you have an answer to solve your problem, but you can use the npm-open module with node servers. Just a quick runthrough:

command line: npm install open 

You can then open 4 different tabs from 4 different html pages that you create dynamically or statically. Make sure you have the port open

var open = require('open');    
open('http://localhost:' + port + '/' + option.html , 'browser'); 

Hope that helps!

Maximus
  • 56
  • 3