Cannot read property 'toFixed' of undefined. Uncaught TypeErrorDetecting an undefined object propertyFrame Buster Buster … buster code neededExplain the encapsulated anonymous function syntaxGoogle MAP API Uncaught TypeError: Cannot read property 'offsetWidth' of nullUncaught TypeError: Cannot read property 'msie' of undefinedUncaught TypeError: Cannot read property 'msie' of undefined - jQuery toolsReactJS - Does render get called any time “setState” is called?Datatables: Cannot read property 'mData' of undefinedReact - uncaught TypeError: Cannot read property 'setState' of undefinedUncaught TypeError: Cannot read property 'isHit' of undefined
“all of who” or “all of whom”?
Do universities maintain secret textbooks?
Storing milk for long periods of time
Group riding etiquette
What caused the end of cybernetic implants?
Fixing a blind bolt hole when the first 2-3 threads are ruined?
What is the motivation behind designing a control stick that does not move?
How to differentiate between two people with the same name in a story?
German equivalent to "going down the rabbit hole"
What's the difference between a variable and a memory location?
Lob Logical Read and lob read-ahead reads in NCCI
How do I portray irrational anger in first person?
What am I looking at here at Google Sky?
What is a "hashed transaction" in SQL Server Replication terminology?
Unexpected behavior after assignment of function object to function wrapper
IList<T> implementation
An ant walks on a cube over the diagonals of little cubes. Can it visit all little faces exactly once?
How do I get my neighbour to stop disturbing with loud music?
How to get a B2B company to take chances on their image?
What's the origin of the concept of alternate dimensions/realities?
Can copper pour be used as an alternative to large traces?
Ask one verbal question to figure out who is blind and who is mute among three persons
Is "prohibition against," a double negative?
Why is there no Disney logo in MCU movies?
Cannot read property 'toFixed' of undefined. Uncaught TypeError
Detecting an undefined object propertyFrame Buster Buster … buster code neededExplain the encapsulated anonymous function syntaxGoogle MAP API Uncaught TypeError: Cannot read property 'offsetWidth' of nullUncaught TypeError: Cannot read property 'msie' of undefinedUncaught TypeError: Cannot read property 'msie' of undefined - jQuery toolsReactJS - Does render get called any time “setState” is called?Datatables: Cannot read property 'mData' of undefinedReact - uncaught TypeError: Cannot read property 'setState' of undefinedUncaught TypeError: Cannot read property 'isHit' of undefined
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm trying to understand why my code block doesn't work. I am using JQuery as well as vanilla JS.
Here's my code.
// update every 1 second on time.
setInterval(function()
// get current time and duration of entire video
let getTimePaused = video.currentTime;
let vidTime = getTimePaused.toFixed(0);
let formatTime = minTommss(vidTime);
$(".timeLeft").text(
minTommss(vidTime / 60) + " - " + minTommss((video.duration / 60) + 0.01)
);
, 1000);
Any help is much appreciated.
Thanks!
javascript jquery
|
show 2 more comments
I'm trying to understand why my code block doesn't work. I am using JQuery as well as vanilla JS.
Here's my code.
// update every 1 second on time.
setInterval(function()
// get current time and duration of entire video
let getTimePaused = video.currentTime;
let vidTime = getTimePaused.toFixed(0);
let formatTime = minTommss(vidTime);
$(".timeLeft").text(
minTommss(vidTime / 60) + " - " + minTommss((video.duration / 60) + 0.01)
);
, 1000);
Any help is much appreciated.
Thanks!
javascript jquery
Do you understand what the error means? What is the value ofvideo
?
– Felix Kling
Mar 27 at 23:03
Please post the rest of your code,
– Jack Bashford
Mar 27 at 23:04
@FelixKling I do understand it. However, I'm not sure why I'm getting it. Is it because I need to parseInt something?
– Cazador Shaw
Mar 27 at 23:05
You code doesn't show wherevideo
comes from at all, you're not passing it into the function, so why would anyone (including you) assume thatvideo.currentTime
exists as a value?
– Mike 'Pomax' Kamermans
Mar 27 at 23:06
1
"Is it because I need to parseInt something?" No. The error means thatvideo
is a value that doesn't have a propertycurrentTime
. The fix is to either make sure thatvideo
is the value you need or to access the correct property. There is not much more we can say about it without having more context.
– Felix Kling
Mar 27 at 23:07
|
show 2 more comments
I'm trying to understand why my code block doesn't work. I am using JQuery as well as vanilla JS.
Here's my code.
// update every 1 second on time.
setInterval(function()
// get current time and duration of entire video
let getTimePaused = video.currentTime;
let vidTime = getTimePaused.toFixed(0);
let formatTime = minTommss(vidTime);
$(".timeLeft").text(
minTommss(vidTime / 60) + " - " + minTommss((video.duration / 60) + 0.01)
);
, 1000);
Any help is much appreciated.
Thanks!
javascript jquery
I'm trying to understand why my code block doesn't work. I am using JQuery as well as vanilla JS.
Here's my code.
// update every 1 second on time.
setInterval(function()
// get current time and duration of entire video
let getTimePaused = video.currentTime;
let vidTime = getTimePaused.toFixed(0);
let formatTime = minTommss(vidTime);
$(".timeLeft").text(
minTommss(vidTime / 60) + " - " + minTommss((video.duration / 60) + 0.01)
);
, 1000);
Any help is much appreciated.
Thanks!
javascript jquery
javascript jquery
asked Mar 27 at 23:03
Cazador ShawCazador Shaw
1379 bronze badges
1379 bronze badges
Do you understand what the error means? What is the value ofvideo
?
– Felix Kling
Mar 27 at 23:03
Please post the rest of your code,
– Jack Bashford
Mar 27 at 23:04
@FelixKling I do understand it. However, I'm not sure why I'm getting it. Is it because I need to parseInt something?
– Cazador Shaw
Mar 27 at 23:05
You code doesn't show wherevideo
comes from at all, you're not passing it into the function, so why would anyone (including you) assume thatvideo.currentTime
exists as a value?
– Mike 'Pomax' Kamermans
Mar 27 at 23:06
1
"Is it because I need to parseInt something?" No. The error means thatvideo
is a value that doesn't have a propertycurrentTime
. The fix is to either make sure thatvideo
is the value you need or to access the correct property. There is not much more we can say about it without having more context.
– Felix Kling
Mar 27 at 23:07
|
show 2 more comments
Do you understand what the error means? What is the value ofvideo
?
– Felix Kling
Mar 27 at 23:03
Please post the rest of your code,
– Jack Bashford
Mar 27 at 23:04
@FelixKling I do understand it. However, I'm not sure why I'm getting it. Is it because I need to parseInt something?
– Cazador Shaw
Mar 27 at 23:05
You code doesn't show wherevideo
comes from at all, you're not passing it into the function, so why would anyone (including you) assume thatvideo.currentTime
exists as a value?
– Mike 'Pomax' Kamermans
Mar 27 at 23:06
1
"Is it because I need to parseInt something?" No. The error means thatvideo
is a value that doesn't have a propertycurrentTime
. The fix is to either make sure thatvideo
is the value you need or to access the correct property. There is not much more we can say about it without having more context.
– Felix Kling
Mar 27 at 23:07
Do you understand what the error means? What is the value of
video
?– Felix Kling
Mar 27 at 23:03
Do you understand what the error means? What is the value of
video
?– Felix Kling
Mar 27 at 23:03
Please post the rest of your code,
– Jack Bashford
Mar 27 at 23:04
Please post the rest of your code,
– Jack Bashford
Mar 27 at 23:04
@FelixKling I do understand it. However, I'm not sure why I'm getting it. Is it because I need to parseInt something?
– Cazador Shaw
Mar 27 at 23:05
@FelixKling I do understand it. However, I'm not sure why I'm getting it. Is it because I need to parseInt something?
– Cazador Shaw
Mar 27 at 23:05
You code doesn't show where
video
comes from at all, you're not passing it into the function, so why would anyone (including you) assume that video.currentTime
exists as a value?– Mike 'Pomax' Kamermans
Mar 27 at 23:06
You code doesn't show where
video
comes from at all, you're not passing it into the function, so why would anyone (including you) assume that video.currentTime
exists as a value?– Mike 'Pomax' Kamermans
Mar 27 at 23:06
1
1
"Is it because I need to parseInt something?" No. The error means that
video
is a value that doesn't have a property currentTime
. The fix is to either make sure that video
is the value you need or to access the correct property. There is not much more we can say about it without having more context.– Felix Kling
Mar 27 at 23:07
"Is it because I need to parseInt something?" No. The error means that
video
is a value that doesn't have a property currentTime
. The fix is to either make sure that video
is the value you need or to access the correct property. There is not much more we can say about it without having more context.– Felix Kling
Mar 27 at 23:07
|
show 2 more comments
1 Answer
1
active
oldest
votes
I actually fixed it.
In my case, the problem didn't have anything to do with toFixed()
.
My problem was due to mixing JQuery and Vanilla Javascript.
Like this,
let video = $(".video");
video.on("timeupdate", function()
let colorPos = video.currentTime / video.duration;
color.style.width = colorPos * 100 + "%";
if (video.ended)
btn.className = "replay";
);
Solution
let video = document.querySelector(".video");
video.addEventListener("timeupdate", function()
let colorPos = video.currentTime / video.duration;
color.style.width = colorPos * 100 + "%";
if (video.ended)
btn.className = "replay";
);
2
As I said, the error means that the value ofgetTimePaused
isundefined
, which means thatvideo
doesn't have the propertycurrentTime
. jQuery objects don't have that property. Another solution would have been to usevideo[0].currentTime
. And that's why it was important to tell us what the value ofvideo
is. If we had known, we could have immediately pointed out what was wrong.
– Felix Kling
Mar 27 at 23:41
can you please update your question with the code that you decided to show here, too?
– Mike 'Pomax' Kamermans
Mar 28 at 0:04
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55387791%2fcannot-read-property-tofixed-of-undefined-uncaught-typeerror%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I actually fixed it.
In my case, the problem didn't have anything to do with toFixed()
.
My problem was due to mixing JQuery and Vanilla Javascript.
Like this,
let video = $(".video");
video.on("timeupdate", function()
let colorPos = video.currentTime / video.duration;
color.style.width = colorPos * 100 + "%";
if (video.ended)
btn.className = "replay";
);
Solution
let video = document.querySelector(".video");
video.addEventListener("timeupdate", function()
let colorPos = video.currentTime / video.duration;
color.style.width = colorPos * 100 + "%";
if (video.ended)
btn.className = "replay";
);
2
As I said, the error means that the value ofgetTimePaused
isundefined
, which means thatvideo
doesn't have the propertycurrentTime
. jQuery objects don't have that property. Another solution would have been to usevideo[0].currentTime
. And that's why it was important to tell us what the value ofvideo
is. If we had known, we could have immediately pointed out what was wrong.
– Felix Kling
Mar 27 at 23:41
can you please update your question with the code that you decided to show here, too?
– Mike 'Pomax' Kamermans
Mar 28 at 0:04
add a comment |
I actually fixed it.
In my case, the problem didn't have anything to do with toFixed()
.
My problem was due to mixing JQuery and Vanilla Javascript.
Like this,
let video = $(".video");
video.on("timeupdate", function()
let colorPos = video.currentTime / video.duration;
color.style.width = colorPos * 100 + "%";
if (video.ended)
btn.className = "replay";
);
Solution
let video = document.querySelector(".video");
video.addEventListener("timeupdate", function()
let colorPos = video.currentTime / video.duration;
color.style.width = colorPos * 100 + "%";
if (video.ended)
btn.className = "replay";
);
2
As I said, the error means that the value ofgetTimePaused
isundefined
, which means thatvideo
doesn't have the propertycurrentTime
. jQuery objects don't have that property. Another solution would have been to usevideo[0].currentTime
. And that's why it was important to tell us what the value ofvideo
is. If we had known, we could have immediately pointed out what was wrong.
– Felix Kling
Mar 27 at 23:41
can you please update your question with the code that you decided to show here, too?
– Mike 'Pomax' Kamermans
Mar 28 at 0:04
add a comment |
I actually fixed it.
In my case, the problem didn't have anything to do with toFixed()
.
My problem was due to mixing JQuery and Vanilla Javascript.
Like this,
let video = $(".video");
video.on("timeupdate", function()
let colorPos = video.currentTime / video.duration;
color.style.width = colorPos * 100 + "%";
if (video.ended)
btn.className = "replay";
);
Solution
let video = document.querySelector(".video");
video.addEventListener("timeupdate", function()
let colorPos = video.currentTime / video.duration;
color.style.width = colorPos * 100 + "%";
if (video.ended)
btn.className = "replay";
);
I actually fixed it.
In my case, the problem didn't have anything to do with toFixed()
.
My problem was due to mixing JQuery and Vanilla Javascript.
Like this,
let video = $(".video");
video.on("timeupdate", function()
let colorPos = video.currentTime / video.duration;
color.style.width = colorPos * 100 + "%";
if (video.ended)
btn.className = "replay";
);
Solution
let video = document.querySelector(".video");
video.addEventListener("timeupdate", function()
let colorPos = video.currentTime / video.duration;
color.style.width = colorPos * 100 + "%";
if (video.ended)
btn.className = "replay";
);
answered Mar 27 at 23:11
Cazador ShawCazador Shaw
1379 bronze badges
1379 bronze badges
2
As I said, the error means that the value ofgetTimePaused
isundefined
, which means thatvideo
doesn't have the propertycurrentTime
. jQuery objects don't have that property. Another solution would have been to usevideo[0].currentTime
. And that's why it was important to tell us what the value ofvideo
is. If we had known, we could have immediately pointed out what was wrong.
– Felix Kling
Mar 27 at 23:41
can you please update your question with the code that you decided to show here, too?
– Mike 'Pomax' Kamermans
Mar 28 at 0:04
add a comment |
2
As I said, the error means that the value ofgetTimePaused
isundefined
, which means thatvideo
doesn't have the propertycurrentTime
. jQuery objects don't have that property. Another solution would have been to usevideo[0].currentTime
. And that's why it was important to tell us what the value ofvideo
is. If we had known, we could have immediately pointed out what was wrong.
– Felix Kling
Mar 27 at 23:41
can you please update your question with the code that you decided to show here, too?
– Mike 'Pomax' Kamermans
Mar 28 at 0:04
2
2
As I said, the error means that the value of
getTimePaused
is undefined
, which means that video
doesn't have the property currentTime
. jQuery objects don't have that property. Another solution would have been to use video[0].currentTime
. And that's why it was important to tell us what the value of video
is. If we had known, we could have immediately pointed out what was wrong.– Felix Kling
Mar 27 at 23:41
As I said, the error means that the value of
getTimePaused
is undefined
, which means that video
doesn't have the property currentTime
. jQuery objects don't have that property. Another solution would have been to use video[0].currentTime
. And that's why it was important to tell us what the value of video
is. If we had known, we could have immediately pointed out what was wrong.– Felix Kling
Mar 27 at 23:41
can you please update your question with the code that you decided to show here, too?
– Mike 'Pomax' Kamermans
Mar 28 at 0:04
can you please update your question with the code that you decided to show here, too?
– Mike 'Pomax' Kamermans
Mar 28 at 0:04
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55387791%2fcannot-read-property-tofixed-of-undefined-uncaught-typeerror%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Do you understand what the error means? What is the value of
video
?– Felix Kling
Mar 27 at 23:03
Please post the rest of your code,
– Jack Bashford
Mar 27 at 23:04
@FelixKling I do understand it. However, I'm not sure why I'm getting it. Is it because I need to parseInt something?
– Cazador Shaw
Mar 27 at 23:05
You code doesn't show where
video
comes from at all, you're not passing it into the function, so why would anyone (including you) assume thatvideo.currentTime
exists as a value?– Mike 'Pomax' Kamermans
Mar 27 at 23:06
1
"Is it because I need to parseInt something?" No. The error means that
video
is a value that doesn't have a propertycurrentTime
. The fix is to either make sure thatvideo
is the value you need or to access the correct property. There is not much more we can say about it without having more context.– Felix Kling
Mar 27 at 23:07