2013-03-20 3 views
0

전화, SMS 및 이메일과 같은 모든 모바일 기능이있는 페이지 (jobs.php)가 있습니다. 이 페이지는 기본 index.php 페이지의 iframe으로 액세스합니다. 전화 나 SMS 또는 전자 메일을 보내기 전에 데이터베이스에 항목을 기록하는 기능을 만들었습니다.Android의 Chrome에서 iframe의 href가 동적으로 작동하지 않습니다.

jobs.php 코드

자바 스크립트 (모든 변수가 정의 및 작업)

<img src=\""+imgpath+"email_logo.png\"onclick=\"setMailLog('"+installername+"',"+customerId+",'"+email+"')\" id=\"mimg_"+customerId+"\"/> 


function setMailLog(installerName, customerId,email){ 
     console.log("Email Attempted:"); 
    $.ajax({ 
     url: 'functions.php', 
     type: 'POST', 
     dataType:'text', 
     data: 'elogins='+installerName+'&elogcid='+customerId, 
     success: function(result){ 
     console.log(result); 
     $("#mimg_"+customerId).wrap('<a id="mhrefid_'+customerId+'" target="_blank"></a>'); 
     $('#mhrefid_'+customerId).attr('href','mailto:'+email); 
     window.location.href=$("#mhrefid_"+customerId).attr('href'); 
     } 

    }); 

    } 

이 모든 데스크톱 브라우저에서 완벽하게 잘 작동한다. 안드로이드의 기본 브라우저에서 잘 작동하지만 안드로이드에서 크롬을 깨뜨립니다. 이는 모바일 기능이며 모든 브라우저에서 모바일 장치에서 작동해야하기 때문에 중요합니다.

내가 안드로이드에 크롬에서 메일 아이콘을 클릭

, 그것은 오류 페이지는 특정 iframe에 아닌 전체의 index.php 파일에 나타

The web page at mailto:email might be temporarily down or it may have removed permanently to a new address 

Error 302(net::ERR_UNKNOWN_URL_SCHEME): Unknown error 

말한다.

전화 및 SMS 기능 같은 방식으로, tel:5225 또는 sms:5114

그냥 오류 변경이 iframe에 모두, 즉 문제의 원인이 무엇인가 할 수있다?

답변

1

나에게 버그처럼 보입니다. 나는 https://code.google.com/p/chromium/issues/detail?id=223146

이 문제를 해결하려면, iframe이 아닌 최상위 페이지의 위치를 ​​변경

window.top.location.href=$("#mhrefid_"+customerId).attr('href'); 

window.location.href=$("#mhrefid_"+customerId).attr('href'); 

을 대체 추적 표를 만들었습니다 Chrome에서 잘 작동합니다.

+0

감사합니다. 자파. 오늘 밤이 해결책을 시도해 보겠습니다. Galaxy에서만 문제가 발생하며 Chrome 태블릿에서 제대로 작동합니다. 이상한!! – Abstract

+0

위대한 !! 그게 효과가 있지만 작은 문제는 콘솔을 지우는 것뿐입니다. 저것을 막을 수있는 방법이 있습니까? – Abstract

+0

콘솔을 마우스 오른쪽 버튼으로 클릭하고 "탐색시 로그 보존"을 선택하십시오. –

관련 문제