[mapserver-users] aJAX

Stephen Woodbridge woodbri at swoodbridge.com
Mon Dec 7 13:47:36 EST 2009


You have:

if (url.length == )) {

which looks like a typo.

-Steve

Jay Kapalczynski wrote:
> 
> 
> I am trying to write some ajax here to run a query.  I simplified this 
> down so that no query is happening, rather just getting all the pages to 
> work together and return some text.
> 
> I don’t know whats going on here
> 
>  
> 
> 1.       I created a button that calls a javascript function
> 
>  
> 
> <input type="button" value="Send to Ajax and Tab" 
> onClick="ReturnQueryResults();">
> 
>  
> 
>  
> 
> 2.       This function is calling and passing an ajax page some info.
> 
>  
> 
> function ReturnQueryResults() {
> 
>  
> 
>                  getRunquery('parcellinktest.php','1211922220012','S')
> 
>  
> 
>                 /* 
> getResulthype('parcellinktest.php','1211922220012','S')  */
> 
> }
> 
>  
> 
> 3.       Once there it (depending on what is commented out in the ajax 
> page) it runs one of two functions (both of which are IDENTICAL)
> 
> But for some reason when I run the getRunquery I get errors….but when I 
> run the getResulthype it works.
> 
> I am passing the same values to the same php page.
> 
> I just added the getRunquery to the ajax page.
> 
>  
> 
>  
> 
> *function getResulthype(page,id,type){ *
> 
>  
> 
>     var _target = 'content_details_form';
> 
>    
> 
>     if (id.length == 0) {
> 
>         document.getElementById(_target).innerHTML="<b>No Information 
> Available</b>";
> 
>         return;
> 
>     }
> 
>     xmlHttp = GetAJAXObject();
> 
>     if (xmlHttp==null) {
> 
>         alert ("Unable to process your request, your browser does not 
> support AJAX!");
> 
>         return;
> 
>     }
> 
>     var url = 
> "http://127.0.0.1:80/geomoose/php/"+page+"?id="+id+"&type="+type;
> 
>                
> 
>     xmlHttp.onreadystatechange = showResult;
> 
>     xmlHttp.open("GET",url,true);
> 
>     xmlHttp.send(null);
> 
> }
> 
>  
> 
> *function getRunquery(page,id,type){ *
> 
>  var _target = 'content_details_form';
> 
>                
> 
> if (url.length == )) {
> 
>        document.getElementById(_target_.innerHTML="<b>No Information 
> Available</b>";
> 
>         return;
> 
> }
> 
> xmlhttp = GetAJAXObject();
> 
> if {xmlHttp==null) {
> 
>                 alert ("Unable to process you request, your browser does 
> not support AJAX");
> 
>                 return;
> 
> }
> 
>   var url = 
> "http://127.0.0.1:80/geomoose/php/"+page+"?id="+id+"&type="+type;
> 
>  
> 
>   xmlHttp.onreadystatechange = showResult;
> 
>   xmlHttp.open("GET",url,true);
> 
>   xmlHttp.send(null);
> 
> }
> 
>  
> 
>  
> 
>  
> 
>  
> 
> I thought something might be hanging so I cleared all temp files, shut 
> down, restarted Apache.
> 
>  
> 
> If the values are the same, and they are being sent to the same page how 
> can I be getting errors….
> 
>  
> 
> Error:
> 
> getRunquery is not defined
> 
> getRunquery('parcellinktest.php','1211922220012','S')
> 
>  
> 
>  
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users



More information about the mapserver-users mailing list