Marsc
asked on
Java script acces denied.
Hello experts.
The final idea is to give my users the hability to place some content from my site on their. by providing the html (For example: "Put this survey in your site, just copy and paste this code in your page").
Every yhing is fine if the page where the code is placed is on the same domain, but i get acces denied when i place the code on a page in a diferent domain.
At the momento the code i would provide would be exactly as appears below, (Of course it is subject to change as the development advances).
The file script/ppublthirdparty.js works fine in other conditions (same domain)
the function PlspubSendDataGetContent takes three params.
1 a querystring, 2, The element to change, note "33" the same as the div id, 3 the page where the request should be made.
What it does is to send the query string in the first parameter (Post method) to the page in the third parameter, and then change the innerHTML indicated in the second parameter with the result returned from the post rquest. (Using the request object as described in any AJAX tutorial).
One thing I should mention is that some where in the function i try to get the window.location
I did not use iframe for the simple reason that I cant tell the survey height i developing time.
Note that the content contains more calls to the same jscript function.
Not using https.
Can anyone tell me how to succesfully provide content to third parties? Any solution please.
Thanks in advance.
The final idea is to give my users the hability to place some content from my site on their. by providing the html (For example: "Put this survey in your site, just copy and paste this code in your page").
Every yhing is fine if the page where the code is placed is on the same domain, but i get acces denied when i place the code on a page in a diferent domain.
At the momento the code i would provide would be exactly as appears below, (Of course it is subject to change as the development advances).
The file script/ppublthirdparty.js works fine in other conditions (same domain)
the function PlspubSendDataGetContent takes three params.
1 a querystring, 2, The element to change, note "33" the same as the div id, 3 the page where the request should be made.
What it does is to send the query string in the first parameter (Post method) to the page in the third parameter, and then change the innerHTML indicated in the second parameter with the result returned from the post rquest. (Using the request object as described in any AJAX tutorial).
One thing I should mention is that some where in the function i try to get the window.location
I did not use iframe for the simple reason that I cant tell the survey height i developing time.
Note that the content contains more calls to the same jscript function.
Not using https.
Can anyone tell me how to succesfully provide content to third parties? Any solution please.
Thanks in advance.
<script type="text/javascript" src="http://test.pulsopublico.com/script/ppublthirdparty.js"></script>
<div id="33">
</div>
<script type="text/javascript">
PlspubSendDataGetContent ('rq=gtsrv&srvid=000917828838604&wdth=280','33','http://test.pulsopublico.com/surveys.aspx');
</script>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
See the help:
https://www.experts-exchange.com/help.jsp
Under "Asking questions"
Specifically: The correct answer to some questions is "You can't do that."
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
ASKER
I really didn't find the solution on this.
I can't give a bloger a serverside script, thats not acceptable.
The implemented solution was finally the use of an iframe, and normal form post. That worked well, I would prefer an ajax solution, but it is not possible it seems.
I would delete this question if noone have objections.