testing - Ajax works perfectly on localhost BUT not returning data once moved online -
this has puzzled me greatly. have small ajax setup take user entry , process information , return information user. works on localhost. once moved test server takes user input not return information user. have reduced amount of information bare bones troubleshoot, still nothing not return any. i've checked other people seemed face similar problem , followed several suggestions helped them, didn't work me. appreciated.
here's js code
$('input#name-submit').click(function(){ var name = $('input#name').val(); //var tld = $('select#tld').val(); if($.trim(name) != ''){ $.post('ajaxpop.php', {name: name}, function(data){ $('div#name-data').html(data); /*$('input#name-submit').css('display', 'none'); $('input#searching').css('display', 'none'); $('image#done').css('display', ''); */ }) } });
this php code below
if(isset($_post['name']) === true && empty($_post['name']) === false){ $namex = $_post['name']; $expld = explode(".", $namex ); $name = $expld[0]; $tld1 = $expld[1]; $tld2 = $expld[2]; $sld = $name; if( strlen($tld2) > 0 ){ $tld = "$tld1.$tld2"; }else{ $tld = $tld1; } if( $namex == "enter domain e.g. mydomainx.com" ){ $domain = ""; $msg = "enter domain"; }else{ $namecheck = $domain->domaincheck( $sld, $tld ); $domain = "$name.$tld"; $url = "http://www.$domain"; $domaincheck = $sitecheck->isurlalivesocks( $url ); if( $domaincheck == false ){ $domain_status = "domain down"; } if( $domaincheck == true ){ $domain_status = "domain up"; } if( $namecheck == "yes" ){ $msg = "domain check result yes"; }else{ $msg = "domain check result no"; } } //echo $msg; exit($msg); }
this html code
<tr> <td width="164" align="left" valign="top"> <input type="image" id="name-submit" src="../images/btn_search2.png" alt="search" align="middle" width="88" height="48" border="0" style="display:;" onclick="document.getelementbyid('name-submit').style.display='none'; document.getelementbyid('name-data').style.display=''; document.getelementbyid('searching').style.display='';" /> <img src="../images/btn_searching.png" id="searching" style="display:none;" /> </td> </tr> <tr > <td height="30" colspan="2" align="left" id="names-data" style="display:; padding-left:42px;"> <div align="left" id="name-data" style="display:none;"><img src="../images/loading.gif" /></div> </td> </tr>
hope hear 1 soon. in advance.
Comments
Post a Comment