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

  • Home
  • SEARCH
  • 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 7629523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:51:24+00:00 2026-05-31T05:51:24+00:00

I have a function written in coffeescript that used to work fine but now

  • 0

I have a function written in coffeescript that used to work fine but now throws an ‘Invalid Pointer’ exception in ie8.

The Coffee Script

convertSVGforIE = ->

  if not $.support.svg or device.ff36
    imagesToConvert = $('img.SVG')
    imagesToConvert.each ->
      imageSrcMinus = this.src.substr 0, this.src.length - 3
      this.src = imageSrcMinus + 'png'

The Javascript

convertSVGforIE = function() {
    var imagesToConvert;
    if (!$.support.svg || device.ff36) {
      imagesToConvert = $('img.SVG');
      return imagesToConvert.each(function() {
        var imageSrcMinus;
        imageSrcMinus = this.src.substr(0, this.src.length - 3); //Invalid pointer
        return this.src = imageSrcMinus + 'png';
      });
    }
};

I can’t see anything wrong with my script. Please help me determine, what is ie8’s problem.

UPDATE:
I got this to work, but not in a good way

convertSVGforIE = ->

  if not $.support.svg or device.ff36
    $('img.SVG').each ->
      that = $(this)
      imageSrcMinus = that.attr('src').substr 0, that.attr('src').length - 3
      that.attr 'src', imageSrcMinus+'png'

The above script works, but why does $(this).attr(‘src’) work? while this.src does not? And why only in IE?

  • 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-05-31T05:51:26+00:00Added an answer on May 31, 2026 at 5:51 am

    If you look at http://msdn.microsoft.com/en-us/library/ms534643(v=vs.85).aspx, it says that

    1. You can only do elem.src from IE8 or later, and
    2. Exactly how this works depends on whether you’re in IE8 Standards Mode or Compatibility Mode.

    If you look at the comments on that page, there are other quirks as well..

    Using jQuery is certainly the easiest fix here, with the pleasant side effect of IE6-7 compatibility, but you may also want to try adding

    <meta http-equiv="X-UA-Compatible" content="IE=8" />
    

    to the head of the page to force IE8 into Standards Mode.

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

Sidebar

Related Questions

I have written function (actually a macro, but whatever) that works similarly to progn
I have a function I've written that was initially supposed to take a string
I have written a function that gets a given number of random records from
I have written a function that positions a tooltip just above a textbox. The
I have written a function for a multilevel wordpress menu, but I'd like it
I have written a function that draws x number of squares in a random
So I have a function, written in C++, that looks like this... extern C
I would like to have a function written in C, but callable from C++
I have a parser function written in my code-behind file, that takes as input
I have a function written in C# which has one parameter type as Dictionary<string

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.