Javascript-форум (https://javascript.ru/forum/)
-   Node.JS (https://javascript.ru/forum/node-js-io-js/)
-   -   Or, if you meant to create an async function, pass `async: true` as an option. (https://javascript.ru/forum/node-js-io-js/81053-if-you-meant-create-async-function-pass-%60async-true%60-option.html)

riaron 21.09.2020 22:56

Or, if you meant to create an async function, pass `async: true` as an option.
 
После того как появился if в value input-а выдает ошибу которая в названии темы вставил объект который переключает рендеринг на ассихронный ошибка не поменлась
for (var i = 0; i < rows.length; i++) {

	  			// Create an object to save current row's data
		  		var smartphopne = {
		  			'id':rows[i].id,
		  			'prod':rows[i].prod,
		  			'name':rows[i].name,
		  			'photo':rows[i].photo,
		  			'description':rows[i].description,
		  			'price':rows[i].price,
		  			'sale':rows[i].sale,
		  			'len':rowlenght,
					'tsale':rows[i].tsale,
					'prmin':prmin,
					'prmax':prmax,
					'cprmax':req.cookies.prmax,
					'cprmax':req.cookies.prmax,

					  
		  		};
		  		// Add object into array
		  		smartphopneList.push(smartphopne);
	 	 	}
	  	// Render index.pug page using array 
		  res.render('index', {"smartphopneList": smartphopneList}, {async: true});
	  	}
	});



<td>Мин.
				  <input class="bradius" id="prmin" type="text" name="prmin" placeholder="" value="<% if(!smartphopneList[0]['cprmin']){echo smartphopneList[0]['prmin'];}else{echo smartphopneList[0]['cprmin'];}%>" onblur="jsprmin()"/>
				</td>
				<td>Макс.
				  <input class="bradius" id="prmax" type="text" name="prmax" placeholder="" value="<% if(!smartphopneList[0]['cprmax']){echo smartphopneList[0]['prmax'];}else{echo smartphopneList[0]['cprmax'];}%>" onblur="jsprmax()"/>
				</td>


Часовой пояс GMT +3, время: 23:32.