Simple right?
Except that my LAMP server is on a different domain than the SharePoint server so that would classify as Cross-Origin and my Ajax would fail.
After a bit of research, I found that I can manipulate the headers sent out by the PHP pages served by my LAMP server to allow for Cross-Origin scripting!
Here's how:
http://LAMP/sql.php
<?php
header('Access-Control-Allow-Origin: http://sharepoint/');
...
# more PHP to query the SQL server & build the resulting page
...
http://SharePoint/List/NewForm.aspx (in CEWP)
<script src='jquery.js'></script>
<script type='text/javascript'>
...
$('#drop-down_id').load('http://LAMP/sql.php');
...
</script>


0 comments:
Post a Comment