|
Google is the place for such questions.
|
|
|
|
|
Can you let me know url please?
I looked for it, I can't find.
Sorry.
|
|
|
|
|
Seriously? You cannot type 'google' into your broweser?
|
|
|
|
|
|
I don't think he was making an advance.
|
|
|
|
|
Don't be naive. You know nothing about Richard.
|
|
|
|
|
There's that. I was giving him the benefit of doubt.
|
|
|
|
|
Hey, you said you wouldn't tell.
|
|
|
|
|
I haven't, yet.
|
|
|
|
|
I'm not sure why everyone is downvoting this, so I upvoted it, but don't think that will help much.
Member 12869945 wrote: A image screenshot of what I'm looking for is attached. No, it's not.
But all you have to do is view source on a webpage and start to look through and find what library they are using.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
RyanDev wrote: I'm not sure why everyone is downvoting this, so I upvoted it, but don't think that will help much.
You missed the spam link.
His other messages were also spam, as was his would-be article.
Spam would be article[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Richard Deeming wrote: You missed the spam link. OP had a link to their blog in their signature. That is allowed.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
OP had a spam would-be article and three messages with spam links to the same site.
If you want to argue the toss, take it to the Spam forum and reply to the original report.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Richard Deeming wrote: If you want to argue the toss, take it to the Spam forum and reply to the original report. First off, I wasn't arguing. Secondly, no one in that forum cares so it's nearly pointless. It's a forum used to boost rep points and egos.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hi, I really new to javascript. I was doing a JavaScript program that accept two integers and display the larger.
Below is the program, It only displays the 2nd number. Can you tell me what i am doing wrong in this please?????
var x = prompt("Enter 1st number");
var y = prompt ("Enter 2nd number");
if(x>y){
alert(x);
}
else {
alert(y);
}
I will really appreciate your help and this helps me to learn more..
|
|
|
|
|
The prompt() method[^] returns a string[^].
When you compare two strings, you are comparing them character-by-character; if they're not exactly the same length, you won't get a numeric comparison. For example, the string "10" is less than the string "2" , because the first character of the first string ("1" ) is less than the first character of the second string ("2" ).
To get a numeric comparison, you need to convert the strings to numbers. If you're only expecting whole numbers, use parseInt[^]; for floating-point numbers, use parseFloat[^].
You can also use Math.max()[^] to get the higher number without an if / else block.
var x = prompt("Enter 1st number");
var xAsNumber = parseInt(x, 10);
while (isNaN(xAsNumber)) {
x = prompt("Enter 1st number");
xAsNumber = parseInt(x, 10);
}
var y = prompt("Enter 2nd number");
var yAsNumber = parseInt(y, 10);
while (isNaN(yAsNumber)) {
y = prompt("Enter 2nd number");
yAsNumber = parseInt(y, 10);
}
var highestNumber = Math.max(xAsNumber, yAsNumber);
alert(highestNumber);
if (xAsNumber > yAsNumber) {
alert(xAsNumber);
}
else {
alert(yAsNumber);
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Ohh.., Thanks a lot Richard. I really appreciate your help. I have one more question, why we are using 10 in this
xAsNumber = parseInt(x, 10); and what is
isNaN
Thanks alot in advance..
|
|
|
|
|
Passing 10 as the second argument to parseInt is to prevent it from trying to guess the radix based on the string.
In some older implementations, calling parseInt("010") would return 8 , not 10 . The 0 prefix on the string would be interpreted to mean that the string contains an Octal[^] number.
Even in modern implementations, parseInt("0x10") will return 16 , because the 0x prefix denotes a Hexadecimal[^] number.
The isNaN method[^] determines whether the argument is N ot a N umber. This is a special value returned from parseInt / parseFloat when the input cannot be converted to a number.
So, for example, if the user types in "foobar" for the first number, parseInt will return NaN , and you need to ask the user to type the number again.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks a lot. You made this very easy to understand. Thanks once again.
|
|
|
|
|
Hey abdul,
It works fine for me. Again check this program in some other IDE, it will surely execute.
Hope this helps you.
Pawan Kumar
|
|
|
|
|
I've got this script which works out a users pension after they enter in their Total Years in the Scheme 'pensionYears' along with their salary. - This bit works fine - a function called doMath() works out lots of other financial stuff.
I've now put 2 calendars in there: 'dateStart' and 'dateEnd'.
I want to use the difference between these 2 dates to work out the user's total years in service instead of having the user enter in the total years. I've got part of this working - I've got a text box called 'diffYrs' which does work out the difference between the 2 dates.
What I can't do is grab the value from 'diffYrs' and use this in my doMath() function and make 'pensionYears' = 'diffYrs'. Not sure if this is to do with the fact that its outside the scope and needs to be declared as some kind of global variable? - I tried putting everything inside the same function but that didn't work (not sure if that's because one is more a jquery script and other javaScript?)
I was trying to use something like:
var pensionYears = $('#diffYrs');
here's a fiddle:
https://jsfiddle.net/yorkshireweb/ye2nboxL/
thanks for looking
modified 12-Jan-17 5:29am.
|
|
|
|
|
Either read the value from the diffYrs input instead of the pensionYears input:
var pensionYears = $('#diffYrs').val();
or update both inputs when the end date changes:
$("#diffYrs, #pensionYears").val(custRound(years,2));
Here's an updated fiddle:
Edit fiddle - JSFiddle[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
thanks Richard, both work!
I thought I'd tried the first option before, but might have put it in the wrong place or had something else wrong at the time).
|
|
|
|
|
Hi All,
This Tab Add/Close functionality working as a static . I want to how to dynamically Add/Close tab items.
implemented code :
<html>
<head runat="server">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="js/JavaScript.js"></script>
<script type="text/javascript">
function openfunc()
{
winGoogle = window.open("http://google.com");
winGmail = window.open("http://gmail.com");
winMsdn = window.open("http://msdn.com");
winyahoo = window.open("http://yahoo.com");
windeveloper = window.open("http://developercenter.azurewebsites.net/");
}
function closefunc()
{
winGoogle.close();
winGmail.close();
winMsdn.close();
winyahoo.close();
windeveloper.close();
}
</script>
</head>
<body>
<h1>Multiple Tab</h1>
<input type="button" value="Open tab" onclick="openfunc()"/>
<input type="button" value="Close all tab" onclick="closefunc()"/>
</body>
</html>
How to implemented dynamically
Thanks,
|
|
|
|
|
I am trying to write code for my calendar next and previous buttons. But after a lot of tries I still can't figure it out. Here is HTML:
<div class="calendar-container">
<div class="calendar-header">
<a href="#" class="arrows" id="prevArrow">
<div class="prev-arrow-container"></div>
</a>
<div class="year-month-selector">
<select id="year" class="select-properties"></select>
<select id="month" class="select-properties"></select>
</div>
<a href="#" class="arrows" id="nextArrow">
<div class="next-arrow-container"></div>
</a>
</div>
<div class="calendar-body" id="calendar-body">
<div class="day-names" id="dayNames"></div>
<div id="days-container"></div>
</div>
</div>
Here is some JS:
setHandlers() {
var prevButton = document.getElementById('prevArrow');
var nextButton = document.getElementById('nextArrow');
nextButton.addEventListener('click', function () {
this.next();
}.bind(this));}
next() {
var currentYear = this.currentDate.getFullYear();
var currentMonth = this.currentDate.getMonth();
if (currentYear === YEAR_END && currentMonth === 11) {
return;
}
this.currentDate.setMonth(currentMonth + 1);
this.setDate();}
setDate() {
var currentYear = this.currentDate.getFullYear();
var currentMonth = this.currentDate.getMonth();
this.yearSelector.selectedIndex = currentYear - YEAR_START;
this.monthSelector.selectedIndex = currentMonth;}
createDays() {
var daysContainer = document.getElementById('days-container');
var newDate = new Date(this.currentDate.getFullYear(), this.currentDate.getMonth() + 1, 0);
var lengthOfMonth = newDate.getDate();
var date = 1;
for (var i = 0; i < 42; i++) {
var day = daysContainer.children[i];
if(i < this.startingCell) {
day.innerText = "prev";
day.style.opacity = '.2'
} else if (i > this.startingCell + lengthOfMonth){
day.innerText = "next";
day.style.opacity = '.2'
} else {
day.innerText = date;
date++;
}
}}
The whole source can be found here. Any kind of help is appreciated. It would be okay that you give hints about how to link one of the buttons to the calendar-body, that is when of the prev/next is clicked the calendar-body content is changed respectively back and forward. Thanks in advance.
|
|
|
|