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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:52:56+00:00 2026-06-15T08:52:56+00:00

I have built a content locker widget for members of my website. A content

  • 0

I have built a content locker widget for members of my website. A content locker forces a visitor to complete a survey before it redirects them.

Basically, I need to have Javascript make an Ajax request to my domain and redirect the user if the survey is finished. Let’s just say a PHP script will echo ‘1’ for complete and ‘0’ for incomplete.

This would be trivial normally, but users place the javascript code on THEIR websites, not mine. So I am worried about running into Cross-Scripting flags.

So how do Content lockers do this? I know this is possible because companies like Adscend Media have one.

Also, after designing their widget on my website, they put a code on their website with something like this:

<script type="text/javascript" src="http://mywebsite.com/js/w.php?i=6PS0D9"></script>

This goes in the head tag. Does including this script somehow make Cross-Scripting to my domain available since the script itself is on my domain?

Thanks for any help.

  • 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-15T08:52:57+00:00Added an answer on June 15, 2026 at 8:52 am

    The basic issue you’re concerned about is the “same origin policy”, which is a policy followed by all major browsers to prevent web sites from making AJAX requests to other domains.

    However, the same-origin policy does not limit scripts brought in by <script> tags, which is why content lockers are able to serve any script files they want without issue. Incidentally, this is also how the “JSONP” workaround for the same-origin policy works.

    If you want to allow your customers to make cross-domain requests to your website, you can add their domain name to a special “crossdomain.xml” file on your site, and (current) browsers will allow those requests to work (I forget the name/path of the file, but it should be easy to look-up if you’re interested see here for more info: https://support.ookla.com/entries/21097566-what-is-crossdomain-xml-and-why-do-i-need-it).

    Alternatively your customers could setup a proxy to your server on their’s (probably not something they want to do). Or, you could just use JSONP, which is basically where:

    1. Your user runs JS that adds a script tag to the page; that script tag’s url is something like ‘yoursite.com/shouldILetThisGuyIn/’.
    2. Your server sends them back a JS file with something like var letThisGuyIn = true; function foo() { return letThisGuyIn }
    3. Your user runs ‘foo()’, and gets the result, determining whether to let that guy in or not.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built a new template for my website that re-arranges the content so
I have built a backend system that allows a user to add multiple content
I have built a custom administration panel into a Rails application that allows content
I have built a website with CodeIginer and I want to implement AJAX and
i have built (locally) a silverlight website. It uses a mysql database (had to
I have built a website based on the Jekyll code for the website for
I have built a little editor for resource files. So I show the content
I have built somekinda image-api-key for my website but it doesn't seem to work.
I have built a custom control that extends content control. Within this I have
I have an old custom built content management system in PHP, where users can

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.