Languages

Menu
Sites
Language
jquery mobile과 ajax로 로그인 기능을 구현중인데 웹 시뮬레이터로만 정상 작동합니다.

아이디와 비밀번호를 입력받아서 ajax로 웹서와 통신후 로그인이 성공하면 다음 화면으로 넘어가는 기능을 구현중입니다.

Tizen Web Simulator Application으로는 잘 동작하지만 Tizen 에뮬레이터로는 다음페이지로 넘어가질 않습니다..

ajax 부분 소스코드입니다. url의 서브도메인으로 id를 붙혀서 ajax로 요청하고 서버에서 비밀번호를 가져옵니다..

 

 $(document).on('click', '#submit', function() { // catch the form's submit event
        if($('#username').val().length > 0 && $('#password').val().length > 0){
            // Send data to server through ajax call
            // action is functionality we want to call and outputJSON is our data
                $.ajax({
                 url: '서버주소'+$('#username').val(),
                    type: 'get',
                  
                    success: function (result) {
                     if(result == $('#password').val()) {
                      $.mobile.changePage("#pageone"); 
                     }
                    },
                    error: function (request,error) {
                        // This callback function will trigger on unsuccessful action               
                        alert('Network error has occurred please try again!');
                    }
                });                  
        } else {
            alert('Please fill all nececery fields');
        }  
      
        //   return false; // cancel original event to prevent form submitting

        });

소스코드에 문제가 있어서 에뮬레이터로 실행이 안되는걸까요?

참고로 Tizen SDK 2.4로 개발중이고 프로젝트의 모바일버전은 2.3입니다.

Responses

4 Replies
Iqbal Hossain

Hi~ 

Don't forget to add privilege and allow domains in your config.xml

<access origin="*" subdomains="true"></access>
<tizen:privilege name="http://tizen.org/privilege/internet"/>

Hope it will solve your problem in emulator and real device. 

-Thanks 

세홍 장

Thank you! It work.

André Reus

welcome :))) 

Please select the answer as the best answer if it solved your problem. 

Iqbal Hossain

Glad to know that.