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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:34:34+00:00 2026-06-10T04:34:34+00:00

iFrame in jQuery mobile application causes error : Unsafe JavaScript attempt to access frame

  • 0

iFrame in jQuery mobile application causes error : Unsafe JavaScript attempt to access frame with URL file:///D:/xx/webpage.html from frame with URL http://www.asp.net/. Domains, protocols and ports must match.

I am developing a jQuery mobile application which uses iFrame to load external websites.
My script code is:

  $(document).ready(function () {

$('#divID').prepend('<img  src="http://xxx/images/ICPosternew1002.png" usemap="#map" id="image" style="margin-top:43px;"/>')
    $('#map').append('<area coords="30,0,60,30" id="1" alt="Blah" title="asp" />')
    $("#1").bind("click", function (e) {                
    e.preventDefault();         
           $('#Web1').append('<form id="form1" runat="server" rel="external"></form>')              
        $('#form1').append('<iframe id="iframe1" src="http://asp.net" frameborder="0" rel="external"></iframe>')
        });
    });

I have two virtual pages in my application. On clicking on image map in main page loads the second page with iFrame and the corresponding website.

         <div data-role="page" id="Web" class="pagebody">
    <div data-role="header" data-position="inline" data-theme="a">
            <!--header-->
        </div>
        <div data-role="content" id="Web1">
    <form id="form1" runat="server">
            <iframe id="iframe1" >
            </iframe>
            </form> 
        </div>
        <div data-role="footer" class="footer">
            <!--footer-->
        </div>
    </div>

Is it the problem with my code?

  • 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-10T04:34:35+00:00Added an answer on June 10, 2026 at 4:34 am

    I guess you can solve it this way:

                         $(document).ready(function () {
    
                        var html = "";
                        html += "<div data-role=page id=win2 class=pagebody>";
                        html +=   "<div data-role='header'>";   
                        html +=   "</div>";
                        html +=   "<div data-role=content>";
                        html +=   "</div>";
                        html +=   "<div class=push>";
                        html +=   "</div>";
                        html +=   "<div data-role=footer class=footer>";
                        html +=   "</div>"
                        html += "</div>";
                        $(html).insertAfter ("#index");
                        for(var i=0;i<data.length;i++)
                        {
                            $("#area"+data[i].NodeID+"").bind ("click", function (event)
                            {
                                var title = $(this).attr("src");
                                alert(title);
                                $.mobile.changePage ($("#win2"));
                                $("#win2 div:jqmData(role=content)").empty().append ('<form id="form1" runat="server" rel="external"></form>')
                                $('#form1').empty().append('<iframe id="iframe1" src="'+title+'" frameborder="0" rel="external"></iframe>') 
                            });
                        }       
            });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have an iframe on a HTML page: <iframe src=/script.php></frame> The iframe
I have added an iframe to a JQuery Mobile page: The link to it:
How can I access the content of an iframe with jQuery? I tried doing
I am creating an iframe using jQuery to a cross-site URL. This works properly
I would like to manipulate the HTML inside an iframe using jQuery. I thought
I an using Tinymce Editor. In need to access tinymce iframe with jquery I
I recently implemented a jQuery / iframe solution to file uploading and have run
Hi I had a jquery thickbox modal popu p on my application. ( iframe
I'm currently evaluating the combination of jQuery Mobile and PhoneGap. For my application, I
I'm creating a web-based mobile application using jQuery Mobile. I want to add +1

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.