[mapserver-users] Re: [Geomoose-developers] aJAX

Brent Fraser bfraser at geoanalytic.com
Mon Dec 7 10:53:54 PST 2009


Actually they are not identical (there's an extra ")" in getRunquery.  And there 
could be other syntax problems...



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')
> 
>  
> 
>  
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> ------------------------------------------------------------------------------
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing. 
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Geomoose-developers mailing list
> Geomoose-developers at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geomoose-developers



More information about the MapServer-users mailing list