Dear Maxim,

What I did is following the example:


The openMeetings is installed on a linux server with ip address: 192.168.128.38

        $('#div1').click(function () {
                $.ajax({
                    method: "GET",
                    url: 
"http://192.168.128.38:5080/openmeetings/services/user/login 
<http://192.168.128.38:5080/openmeetings/services/user/login>",
                    data: {user: 'gaoshusheng', pass: '$Admin123'},
                    dataType: "json",
                    success: function(data){
                        alert('success!');
                    },
                    error:function(jqXHR, textStatus, errorThrown){
                        alert('error!');
                    }
                });
            });

After running these line of code on the browser.

the script jump to: alert('error!’);

Although from the debug browser reply, we can see the ID is already replied 
with status “success”. But because the error, we are unable to continue with 
the functions.

The error shows:
> XMLHttpRequest cannot load 
> http://localhost:5080/openmeetings/services/user/login?user=gaoshusheng&pass=%24Admin123
>  
> <http://localhost:5080/openmeetings/services/user/login?user=gaoshusheng&pass=%24Admin123>.
>  No 'Access-Control-Allow-Origin' header is present on the requested 
> resource. Origin 'http://localhost:9090 <http://localhost:9090/>' is 
> therefore not allowed access.



Best regards,
James


> On 26 Dec 2017, at 12:29 PM, Maxim Solodovnik <[email protected] 
> <mailto:[email protected]>> wrote:
> 
> I'm afraid I need something I can run and test ...
> Maybe you can send the link to example github project? 
> 
> On Tue, Dec 26, 2017 at 10:43 AM, James Chan <[email protected] 
> <mailto:[email protected]>> wrote:
> Dear Maxim,
> 
> 
> The error shows:
> 
> XMLHttpRequest cannot load 
> http://localhost:5080/openmeetings/services/user/login?user=gaoshusheng&pass=%24Admin123
>  
> <http://localhost:5080/openmeetings/services/user/login?user=gaoshusheng&pass=%24Admin123>.
>  No 'Access-Control-Allow-Origin' header is present on the requested 
> resource. Origin 'http://localhost:9090 <http://localhost:9090/>' is 
> therefore not allowed access.
> 
> 
> Best Regards,
> James
> 
>> On 26 Dec 2017, at 10:36 AM, Maxim Solodovnik <[email protected] 
>> <mailto:[email protected]>> wrote:
>> 
>> Any additional error details?
>> 
>> On Tue, Dec 26, 2017 at 8:38 AM, Yue Chan <[email protected] 
>> <mailto:[email protected]>> wrote:
>> Dear Maxim,
>> 
>> I have followed your instruction to set the parameters. However, the error 
>> still exists. The jQuery call still jump to error. Is there other things 
>> that I should do?
>> 
>> Thanks and best regards,
>> 
>> James. 
>> 
>> 
>> 
>> 
>> On 23 Dec 2017 6:08 pm, "Maxim Solodovnik" <[email protected] 
>> <mailto:[email protected]>> wrote:
>> I'm here to help ;)
>> 
>> WBR, Maxim
>> (from mobile, sorry for the typos)
>> 
>> On Sat, Dec 23, 2017, 17:06 James Chan <[email protected] 
>> <mailto:[email protected]>> wrote:
>> Hi Maxim,
>> 
>> Thanks for the feedback.
>> 
>> 
>> Best regards,
>> 
>> James
>> 
>> 
>> 
>>> On 20 Dec 2017, at 7:01 PM, Maxim Solodovnik <[email protected] 
>>> <mailto:[email protected]>> wrote:
>>> 
>>> Hello James,
>>> 
>>> Please do not write personal emails (subscribe to user@ list 
>>> http://openmeetings.apache.org/mail-lists.html 
>>> <http://openmeetings.apache.org/mail-lists.html>)
>>> 
>>> According to your question: you need to go to OM->Admin->Config
>>> and update "header.content.security.policy" configuration: 
>>> http://openmeetings.apache.org/GeneralConfiguration.html 
>>> <http://openmeetings.apache.org/GeneralConfiguration.html>
>>> 
>>> 
>>> On Wed, Dec 20, 2017 at 9:11 AM, James Chan <[email protected] 
>>> <mailto:[email protected]>> wrote:
>>> Dear Maxim,
>>> 
>>> I am trying to write a simple application, which having the following code:
>>> 
>>> Environment:
>>> 
>>> openmeetings version 4.0.1 running on linux in another server.
>>> $.ajax({
>>>     method: "GET",
>>>     url: 'http://192.168.128.38:5080/openmeetings/services/user/login 
>>> <http://192.168.128.38:5080/openmeetings/services/user/login>',
>>>     data:{
>>>         user:’TestAccount',
>>>         pass:’@TestingPass'
>>>     },
>>>     dataType:'json',
>>>     success:function (data) {
>>>         alert('success');
>>>     },
>>>     error:function (d) {
>>>         console.log(d);
>>>         alert(d);
>>>     }
>>> });
>>> However, it is having the cross domain error.
>>> 
>>> Could you please help to give me some pointers as I have been trying to 
>>> search the web but with no luck.
>>> (Some suggest using allow-access-control-origin = ‘*’, does it mean I need 
>>> to modify the openmeetings code?)
>>> 
>>> 
>>> 
>>> Thanks
>>> 
>>> James
>>> 
>>> 
>>> 
>>> -- 
>>> WBR
>>> Maxim aka solomax
>> 
>> 
>> 
>> 
>> 
>> -- 
>> WBR
>> Maxim aka solomax
> 
> 
> 
> 
> -- 
> WBR
> Maxim aka solomax

Reply via email to