0

I am using this code (from Harsha Jagadish) that does a quick little speed test to my URL of choice. It outputs the expected result just fine

return this.each(function() {
    var g = foo();
    $(this).text(g).append("Mb per second" + newg);
});

But what I need to do is grab that same output to compare if it's greater or less than a specific number. The issue is it's an object. I tried JSON.stringify and a couple of things, but no luck.

What am i missing?

3
  • 1
    What variable are you trying to compare to a number? Commented Nov 9, 2016 at 22:50
  • stackoverflow.com/questions/5754712/… this link might help Commented Nov 10, 2016 at 8:11
  • So $(this).text(g).append...returns the number I am trying to grab, but if i simply do 'var newno = $(this).text(g)' it returns an [object Object] Commented Nov 10, 2016 at 15:04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.