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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T13:26:41+00:00 2026-05-20T13:26:41+00:00

I have the following code which works perfect in Chrome, IE8, and FF. However,

  • 0

I have the following code which works perfect in Chrome, IE8, and FF. However, I get an error when I’m testing it with IE7. Does anyone have a clue what’s happening here?

 function do_replace(s, p1,p2,p3,child_node,syn_text) {
       reg = new RegExp('[h\|H][1-7]');
   if(p1.length>0){   //this might not be necessary
     //create textnode
      var text_node = document.createTextNode(p1);
          child_node.parentNode.insertBefore(text_node,child_node);  //errors out here in IE7
       }

The code errors out at the last line- IE7 give an “htmlfile: Invalid argument.” error when I look at the code through a debugger. child_node, parentNode, and text_node appear to be formed identical to Firefox and Chrome when running this script.

Any ideas? Or does IE7 just not support this method as well as other browsers?

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-05-20T13:26:42+00:00Added an answer on May 20, 2026 at 1:26 pm

    Rather than leave this problem unsolved, I figured out what was wrong with my code:

    I was using an extensive frameset(yuck!!) and when I made the text_node = document.createTextNode() call, I was not doing this in the frame that my application was in.

    I fixed this by explicitly calling out the frame to create the object in:

    var text_node = MainFrame.child_frame.WhySoManyFrames.document.createTextNode(p1);
    

    After doing this, the insertBefore method works perfect!

    Hopefully this helps anyone looking at this question- I know this took me a long time and lots of frustration to figure out!

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

Sidebar

Related Questions

I have the following code which works fine in ie8 but not in Chrome.
I have the following code which works fine. However, I only want to return
I have trouble to get gluLookAt working. I have the following code which works
I have the following piece of code which works fine and does what it
I have following code which works as is, but does not work when cache=T
I have the following code which works perfect in IE for a textarea element.
I have the following code which works when I am multiplying whole numbers however
I have the following code which works fine, however I wanted to know if
I have following code which works fine, however when I updated to Lion I
I have the following code which works in FF / Chrome var stack =

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.