Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8229377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:46:44+00:00 2026-06-07T16:46:44+00:00

My IDE, RubyMine, says this is potentially incorrect: function update_top_up_prices_via_localStorage(){ var index = localStorage.getItem(volxs);

  • 0

My IDE, RubyMine, says this is “potentially incorrect”:

function update_top_up_prices_via_localStorage(){
    var index = localStorage.getItem("volxs");
    $('.product-inner').each(function(){

        var product = this.getAttribute('data-product-miles');
        var cpm = ((localStorage.getItem("cpm_by_volxs_"+product)).split(","))[index];

        $(this).find('table tbody tr td').each(function(){
            var top_up_miles = Number(this.getAttribute('data-topup-miles'));
            var price = Number(top_up_miles * cpm * 1.06);
            price = price.toFixed(2);
            $(this).text('\u00A3'+price);
        })
    });
}

My IDE says on the var top_up_miles line, “potentially invalid use of this. This checks for javascript this to be the same in closure as in the outer context.

The js works fine in Chrome and IE9. It does not work in IE8.

Is this wrong? Is there a better way to write this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T16:46:46+00:00Added an answer on June 7, 2026 at 4:46 pm

    RubyMine doesn’t know that $().each executes the passed function with a specified this context. If you want to avoid that warning, use

    $(/* ... */).each(function (i, elem) { 
        elem.getAttribute(/* ... */);
    });
    

    etc.

    The reason your code doesn’t work with IE8 probably has nothing to do with that. For greater compatability however, use jQuery-wrapped functions instead of native API functions: $(this).attr instead of this.getAttribute (thanks @freakish)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a n00b in Rails and Rubymine IDE. The Rubymine Help says to To
Is there a function in the RubyMine IDE to export the code in a
I'm using JetBrains Rubymine for developing Rails applications. It's a great IDE but unfortunately
My IDE is expecting a semicolon but I'm not sure where! It is this
I want to use Rubymine's IDE debugger to debug a ruby process running in
Starting Komodo IDE 7 on Ubuntu 11.10 crashes in libcrypto.so during startup (see this
I am trying to run the debugger in Rubymine and I keep getting this
Many even simple editors (e.g. Notepad++ or RubyMine) have this: pressing Ctrl+D duplicates the
IDE = VS7 or 2002 Hi all, I have a really weird problem here.
IDE,SCSI,SSD,SATA or all of those.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.