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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:42:07+00:00 2026-05-23T00:42:07+00:00

I am in the process of creating a web page in which I wish

  • 0

I am in the process of creating a web page in which I wish to replace a <span> element with a new <span> element. The original <span> element is (for example):

  <span class="green_link">;Abbreviation;The definition</span>

The form of the supplied string is <separator><string><separator><string>. The separator is supplied to insure that any special characters in either the first or the second string will not cause parsing difficulties.

A JavaScript function is invoked by the onload event handler for the <body> element. It detects all <span>s with the class of “green_link”. If no such <span> exists, the function exits. Otherwise, for each such <span>, the function creates a new <span> element:

  <span class='revised_green_link'>
    <span class='abbreviation_alone'>
      Abbreviation
    </span>
    <span class='abbreviation_definition'>
      <a id='greenlink_1'></a>
      <a href='#greenlink_1' 
         style='text-decoration:none; 
                font-weight:bold;'>
        <span class='abbreviation'>
          Abbreviation
        </span>
        <span class='definition'>
          The definition
        </span>
      </a>
    </span>
  </span>

Then the function replaces the “green_link” <span> with the newly created “revised_green_link” <span>.

Browsers were tested using a test page and the actual page. Firefox 3.6.12, Opera 11.11, and Safari 5.0.2 displayed what was expected for both pages. Chrome 12.0.742 displays the test page as expected but fails to display the actual page as expected. IE 8 fails to display either page as expected.

I find it interesting that all of the browsers display the web page as expected when they are directed to it on localhost:port once that Visual Studio 2008 has displayed the page using “View in browser” (i.e., http://localhost:1291/BIODAB.html).

Both HTML documents were successfully checked as XHTML 1.0 Strict by the W3C Markup Validation Service. All CSS (both test and actual) was validated successfully at CSS Level 2.1 by the W3C CSS Validation Service. All JavaScript, with the exception of the jQuery JavaScript Library v1.4, was passed through JSLint without errors.

I have no idea what is causing this diverse behavior and would appreciate some thoughts.

  • 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-23T00:42:08+00:00Added an answer on May 23, 2026 at 12:42 am

    In IE8, there are two parts to the failure.

    The first is that the HTTP headers include this line:

     x-ua-compatible: IE=EmulateIE7
    

    which is putting the browser into IE7 mode.

    The second part is that the GreenLinkTest.js contains

    getAttribute("class") 
    

    which doesn’t work in IE7. See getAttribute cannot return class in IE7? for more details.

    I can’t see a problem with Chrome.

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

Sidebar

Related Questions

I am in process of creating an app which had multiple standalone html5 web
I am creating a web page which will be used to monitor and control
I'm new to everything programming and I'm in the process of creating a web
I'm in the process of creating a web service that uses XML to handle
I'm developing gallery in my web application and i was creating script which loads
I'm creating a a web page scraper. I'm attempting to fill a JTable from
I'm in the process of creating a SharePoint web part that needs to use
We are in the process of designing/creating restful web services that will be consumed
I am creating a web application. In which I like to compile a VS
I am creating a web page where someone can visit it. They type a

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.