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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:31:08+00:00 2026-05-30T22:31:08+00:00

I write some html and js to a iframe,not working in IE7/8/9,the error message

  • 0

I write some html and js to a iframe,not working in IE7/8/9,the error message is:$ is not defined?

My code is:

<!DOCTYPE html>
<html>
<head>
    <title>Demo</title>
    <meta charset="utf-8" />
    <script type="text/javascript">
        window.onload=function(){
            var data='<html>\
                          <head>\
                              <meta charset="utf-8">\
                              <title>Demo</title>\
                              <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"><\/script>\
                              <script type="text/javascript">\
                                    $(function(){\
                                        alert("abc");\
                                    });\
                              <\/script>\
                          <\/head>\
                          <body>\
                          </body>\
                      </html>';
            window.frames["code_result"].document.open(); 
            window.frames["code_result"].document.write(data);
            window.frames["code_result"].document.close(); 
        }
    </script>
</head>
<body>
    <iframe id="code_result" frameborder="0" class="frame_result" name="code_result"></iframe>
</body>
</html>

who can tell me why?thanks

update

this error only show in IE78/9,it work well in Chrome and FireFox

  • 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-30T22:31:09+00:00Added an answer on May 30, 2026 at 10:31 pm

    It’s not the code loading the I frame content. It’s ie’s loading order. Simply wrap your I frame script in a window onload function so it allows jquery to load first. Tested and working in ie.

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

Sidebar

Related Questions

I'm beginner and write some HTML code but what I need is when I
I want to write some html code in php. In this html code I
Alright... I'm trying to write some javascript code that will apply to an html
I wrote some CSS in my HTML code to create rollover buttons. Then i
I am looking to write some C# code for linux/windows/mac/any other platform, and am
I'm trying to write some C# code to get to a specific folder in
I'd like to write some (java) code that takes a PDF document, and creates
I have a textarea where I let users write some HTML. They can then
Is there any way to write some html (as you might in a block),
I'm trying to write some code which will highlight any text selected on 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.