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 8032405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:22:26+00:00 2026-06-05T01:22:26+00:00

I am trying to capture a specific commented line. The following code works ok

  • 0

I am trying to capture a specific commented line. The following code works ok for every browser except IE of course:

<script>
var llf = jQuery('.select').contents().filter(function() {
return this.nodeType === 8 // Comment node
})[2].nodeValue.replace("LLF: ", "").trim();
console.log(llf);
alert(llf);
</script>

And this is the HTML:

<td class="select" nowrap="nowrap" rowspan="3">
<!-- NON IDEAL REASON:  1 hour time window -->
<b>$423.59</b><br />
<b>&#163;267.50</b><br />
<!--  Policy Name: Investment Bank -->
<!--LLF: 1253.12 --> //This is the line I want to capture

If there is a way to do it for all browsers great but if you can think of a specific solution for IE + conditional comment is also fine.

Thanks!

  • 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-05T01:22:27+00:00Added an answer on June 5, 2026 at 1:22 am

    IE doesn’t have String#trim, which was only introduced recently in ES5, so it’s throwing an exception when you try to use it. But as you’re using jQuery, you can use jQuery.trim instead:

    var llf = jQuery.trim(jQuery('.select').contents().filter(function() {
        return this.nodeType === 8; // Comment node
    })[2].nodeValue.replace("LLF: ", ""));
    console.log(llf);
    alert(llf);
    

    Live copy | source – works for me in IE7 and IE9, so I’m presuming IE8 as well


    I would recommend breaking that statement down a bit (not least so issues like this are easier to debug), and including the semicolon after the === 8.

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

Sidebar

Related Questions

I am trying capture UIIMage with UIGraphicsBeginImageContext(); but my code capture the whole screen
I am trying to capture output from an install script (that uses scp) and
I trying to capture packets using SharpPcap library. I'm able to return the packets
I'm trying to capture the ENTER event of a TextInput like so: a_txt.addEventListener(fl.events.ComponentEvent.ENTER, aEnter);
I am trying to capture urls in an html page that is being repeated
I'm trying to capture packets from two devices on my network. I have tcpdump
I'm trying to capture the Tab key in a Windows Forms application and do
I'm trying to capture audio, using the method in this question ; with AVCaptureSession
I'm trying to capture all the URLs requested to WAS. I'm running a web
I'm trying to capture the screen and then paint the image to a JFrame

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.