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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:40:35+00:00 2026-05-24T11:40:35+00:00

Hello I want to redirect my Facebook App page to another app page using

  • 0

Hello I want to redirect my Facebook App page to another app page using php and javascript

I have

echo "<script type='text/javascript'>
if(window.top.location.href.toLowerCase().indexOf('http://apps.facebook.com/app1/') != -1) {
    window.top.location.href = 'http://apps.facebook.com/app2/2/';
    alert("Done");
}
else
   alert(window.top.location.href); 
</script>";

But I get an error:

Unsafe JavaScript attempt to access frame with URL http://apps.facebook.com/myapp/?ref=bookmarks from frame with URL http://mydomain.com/?ref=bookmarks. Domains, protocols and ports must match.

Is it possible to redirect from the Facebook Application iFrame without any problem?

  • 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-24T11:40:36+00:00Added an answer on May 24, 2026 at 11:40 am

    due to XSS-resrictions you can set but cannot read top.location.href if your iframe resides on another domain than the page that calls the iframe. If the page you are redirecting to has the same domainname you will be able to check top.location.href. So the logic if your code should be reversed checking if it can access top.location.href and if NOT redirect. put it in a try..catch block to avoid javascript errors when accessing top.location

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

Sidebar

Related Questions

<html> <head> <script type=text/javascript> function show_confirm(){ var r=confirm(Hello or Goodbye?); if (r==true){ alert(Hello); window.location.replace(http://www.google.com/);
hello i'm using this .htaccess code to redirect urls. RewriteEngine on RewriteRule ^printer/([^/\.]+)/?$ printer.php?id=$1
hello i want to make system website like yahoo messenger using PHP. here the
hello i want i have function to get paragraph of selected text. this is
Hello I want to redirect all the requests to url example.com/rock/apps to example.com/rock/apps/webroot using
Hello i want to replace the text in div when user click on it
I have: %{ lorem ipsum dolor sit %{hello world}% amet}% I want: hello world
I have a onclick function like this onclick = function(){alert('hello')} I want to add
Hello mates i have a page View All Applicants.aspx with gridview and a link
I have the following code in a PHP script: <?php if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::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.