2011-11-20 59 views
0

我想在我的服務器端JS的玉視圖頁面中構建一個數據對象。 它具有動態HTML創作爲用戶想要如何將數據對象從玉傳遞給node.js

function addDetail() { 
      var detailHtml = 
       '<tr><td width="55%"><input style="width:98%;" type="text" name="order.detail['+currentDetailCount+'].nam" /></td>' + 
       '<td width="1%"><input type="checkbox" name="order.detail['+currentDetailCount+'].prc" /></td>' + 
       '<td width="1%"><input type="checkbox" name="order.detail['+currentDetailCount+'].beg" /></td>' + 
       '<td width="1%"><input type="checkbox" name="order.detail['+currentDetailCount+'].cut" /></td>' + 
       '<td width="1%"><input type="checkbox" name="order.detail['+currentDetailCount+'].asb" /></td>' + 
       '<td width="49%"><input style="width:98%;"type="text" name="order.detail['+currentDetailCount+'].msc" /></td></tr>'; 
      $('tbody#detailAddTbody').append(detailHtml); 
      currentDetailCount++; 
     } 

,也有身體夫婦更多的領域

select(name='order.cname',id='cname') 
input(type='text', name='order.ordindate', id='ordindate') 

好像我不能檢索從我的服務器「命令」對象插入輸入框邊app.js. 如何將動態構建的數據對象傳遞給服務器端?

回答

1

您應該使用POST或GET方法或阿賈克斯(客戶端JavaScript)將數據發送到服務器的NodeJS側

在玉,它只是在MVC模型充當視圖,你不能傳遞從數據玉到nodejs。