Re: Re: PHP output fails from AJAX call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Please familiarise yourself with the console in your browser. If you’re using Safari or Chrome there is a developer console built in, and if using Firefox I recommend installing Firebug. This error, and any others in your Javascript will be displayed in the console and this whole mailing list conversation could have been avoided.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/

On 30 Jan 2014, at 13:57, Adarsh Sharma <eddy.adarsh@xxxxxxxxx> wrote:

> Thanks Stuart , issue is fixed. You got the root cause.
> 
> Reports are coming now.
> 
> Thanks
> 
> 
> On Thu, Jan 30, 2014 at 7:19 PM, Adarsh Sharma <eddy.adarsh@xxxxxxxxx> wrote:
> Hi Stuart,
> 
> Please check below , ajaxDiv is at the end :-
> 
> [root@]# cat index.html 
> <html>
> <head>
> <center><h1> OTRS Analysis </h1>
> 
> 
> <script>
> function week_report_fun(){
>  var ajaxRequest;  // The variable that makes Ajax possible!
> 
>  try{
>    // Opera 8.0+, Firefox, Safari
>    ajaxRequest = new XMLHttpRequest();
>  }catch (e){
>    // Internet Explorer Browsers
>    try{
>       ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
>    }catch (e) {
>       try{
>          ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
>       }catch (e){
>          // Something went wrong
>          alert("Your browser broke!");
>          return false;
>       }
>    }
>  }
>  // Create a function that will receive data 
>  // sent from the server and will update
>  // div section in the same page.
>  ajaxRequest.onreadystatechange = function(){
>    if(ajaxRequest.readyState == 4 && ajaxRequest.status == 200){
> 
>       var ajaxDisplay = document.getElementById('ajaxDiv');
>       ajaxDisplay.innerHTML = ajaxRequest.responseText; 
> }
>  }i
> var users = document.getElementById('users').value;
> var queryString = "?users=" + users ;
> 
> //document.write(users); 
> 
>  ajaxRequest.open("GET","ajaxex.php?q="+users,true);
>  ajaxRequest.send(); 
> }
> 
> </script>
> </head>
> <body>
> 
> <form>
> User : <select id="users">
> <option value="">Select a user</option>
> <option value="133">an</option>
> 
> <option value="168">ad</option>
> <option value="78">sou</option>
> 
> </select>
> <input type='button' onclick="week_report_fun()" 
>                              value='Weekly Report'/>
> </form>
> <div id='ajaxDiv'>Your result will display here</div>
> </body>
> </html>
> 
> 
> Please let me know if anything else is required
> 
> Thanks
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux