Click here to Skip to main content

JavaScript

 
AnswerRe: Browser Back Button PinmentorKeith Barrow3-Jan-13 4:03 
GeneralRe: Browser Back Button Pinmembertiger1468-Jan-13 0:19 
GeneralRe: Browser Back Button PinmentorKeith Barrow8-Jan-13 2:41 
AnswerRe: Browser Back Button PinmvpSandeep Mewara4-Jan-13 3:55 
AnswerRe: Browser Back Button Pinmembertwseitex8-Jan-13 7:56 
AnswerRe: Browser Back Button PinmemberAnjum.Rizwi15-Jan-13 22:20 
AnswerRe: Browser Back Button Pinmembervinodkumarnie18-Jan-13 23:33 
AnswerRe: Browser Back Button PinmemberDeepak Kr17-Feb-13 23:26 
Generalhow can we set random image in my asp website? Pinmemberkhiladi78631-Dec-12 6:43 
AnswerRe: how can we set random image in my asp website? PinmvpSandeep Mewara4-Jan-13 3:59 
GeneralRe: how can we set random image in my asp website? Pinmemberkhiladi78622-Jan-13 1:52 
GeneralRe: how can we set random image in my asp website? PinmvpSandeep Mewara22-Jan-13 3:34 
Questiongenerate random numbers from specific array Pinmemberaeman29-Dec-12 23:16 
AnswerRe: generate random numbers from specific array PinmvpSandeep Mewara4-Jan-13 4:06 
aeman wrote:
want to generate number from given specific set of numbers

What's the problem with generating random number within a range, see if the random number is not the one you want and then re-get the random number in case it's the one you wanted to avoid?
 
Example;
Random number between 1 to 4.
You wanted one of (1,3,4)
If random number returned is 2, ignore and re-get it.
 
Define a method that takes range start, end and exclude number:
function getRandom(rangeStart, rangeEnd, excludeNo)
{
  var ranNo = GetRandom(rangeStart, rangeEnd);
 
  // ranNo either of: 1, 2, 3, 4
  if(ranNo == excludeNo)
    getRandom(rangeStart, rangeEnd, excludeNo);
  
  return ranNo;
}
Sandeep Mewara
Microsoft ASP.NET MVP 2012 & 2013
 

[My Latest Article(s)]:
How to extend a WPF Textbox to Custom Picker
Server side Delimiters in ASP.NET

AnswerRe: generate random numbers from specific array PinmemberJoe DiNatale4-Jan-13 10:28 
AnswerRe: generate random numbers from specific array PinmemberJohn Y.19-Feb-13 6:47 
Questionaccess info popup page Pinmemberapadana_198928-Dec-12 7:58 
AnswerRe: access info popup page PinmvpSandeep Mewara4-Jan-13 4:13 
AnswerRe: access info popup page Pinmembervinodkumarnie18-Jan-13 23:56 
Questioncontrol other page Pinmemberapadana_198928-Dec-12 7:50 
AnswerRe: control other page Pinmemberaeman29-Dec-12 23:34 
AnswerRe: control other page Pinmemberjkirkerx31-Dec-12 11:34 
QuestionProblem With jQuery AppendTo and Data Attributes [modified] PinmemberAnalogNerd28-Dec-12 4:41 
Questioncss PinmemberSINNAM28-Dec-12 2:32 
AnswerRe: css PinmentorKeith Barrow28-Dec-12 3:33 
Questioncss PinmemberSINNAM28-Dec-12 2:29 
AnswerRe: css PinmvpSandeep Mewara4-Jan-13 4:14 
AnswerFB Connect Javascript Pinmembersasikumar.prs27-Dec-12 0:29 
GeneralRe: FB Connect Javascript Pinmemberkhiladi78631-Dec-12 6:40 
GeneralRe: FB Connect Javascript Pinmemberjkirkerx31-Dec-12 11:36 
AnswerRe: FB Connect Javascript PinmvpSandeep Mewara4-Jan-13 4:17 
QuestionGridview Problem Pinmemberjojoba201122-Dec-12 6:05 
AnswerRe: Gridview Problem PinmvpSandeep Mewara4-Jan-13 4:25 
Questionxna4life Member 13 Points 71 Posts hard code drop down instead of using toolbar and r/s PinmemberxnaLearner21-Dec-12 4:34 
Questioni m using google map its giving little bit problem. Pinmemberkapil sharma 4921-Dec-12 0:52 
AnswerRe: i m using google map its giving little bit problem. PinmvpSandeep Mewara4-Jan-13 4:31 
Question"&nbsp" problem in Javascript PinmemberBrianCampbellMCAD20-Dec-12 13:08 
QuestionRe: "&nbsp" problem in Javascript PinmvpRichard MacCutchan21-Dec-12 0:00 
AnswerRe: "&nbsp" problem in Javascript PinmemberBrianCampbellMCAD21-Dec-12 2:42 
GeneralRe: "&nbsp" problem in Javascript PinmvpRichard MacCutchan21-Dec-12 3:06 
AnswerRe: "&nbsp" problem in Javascript Pinmemberjkirkerx31-Dec-12 11:39 
Questionjquery tabslideout plugin and want to detect when div slide in and out PinmemberTridip Bhattacharjee20-Dec-12 4:54 
AnswerRe: jquery tabslideout plugin and want to detect when div slide in and out Pinmembervbmike21-Dec-12 7:25 
GeneralRe: jquery tabslideout plugin and want to detect when div slide in and out PinmemberTridip Bhattacharjee23-Dec-12 7:35 
GeneralRe: jquery tabslideout plugin and want to detect when div slide in and out Pinmembervbmike23-Dec-12 12:31 
QuestionConvert HTML to PDF (Client Side) PinmemberPhanindra26116-Dec-12 21:07 
QuestionRe: Convert HTML to PDF (Client Side) Pinmemberryanb3118-Dec-12 6:05 
AnswerRe: Convert HTML to PDF (Client Side) PinmemberPhanindra26118-Dec-12 18:50 
GeneralRe: Convert HTML to PDF (Client Side) PinmemberJ4amieC18-Dec-12 22:29 
QuestionCan't figure out why the currentSlide goes 0-3-2 Pinmemberjkirkerx16-Dec-12 13:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.150327.1 | Last Updated 31 Mar 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid