asp.net consultancy chorley ASP.NET Server Side Scripting Wigan
Website Development Radcliffe

A Coder's Notes

Email : ren@techsolus.co.uk
bespoke invoice systems Standish Information Technology Advice Worsley
    development systems Ramsbottom
data manipulation Farnworth access databases Whitefield SQL connections Atherton
online accessible software Leyland software compatible Coppull


Get connected and Online Tottington
remote management Makerfield code and design Aspull

JavaScript Simple If - Else - 16/05/2018

So you have...

  if (req.params.uidf > 0){
    mysql = mysqlgetone
  }else{
    mysql = mysqlgetall
  }

But you can shorthand this to...

mysql = (req.params.uidf > 0 ? mysqlgetone : mysqlgetall)

So basically

mysql equals ( the thing to evaluate and how ? if ti's true then mysql = this : if it's false mysql = this )

 

Post A Comment

Name Comment
programming services asp.net specialist
Valid XHTML 1.0 Transitional
Admin
GD