schlot

Difficulties combining other code with Find NearbyLocation example - error on parser?

Discussion created by schlot on Oct 19, 2012
Latest reply on Oct 23, 2012 by JGravois-esristaff
I am working through the Find Nearby example that uses the Yahoo search and geolocation, but with my own map service. I have an example someone shared with me, written at version 2.4. I thought I could just update the version numbers in the my code,  but any version over 2.7 generates an error that seems to be coming from dojox.mobile.parser.  It seem like I ought to be able to change my older code to have references to the higher API version.

This works:
<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="format-detection" content="telephone=yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    
    <title>
      Find Nearby WIC Locations
    </title>
      <link type="text/css" rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.7/js/dojo/dojox/mobile/themes/iPhone/iPhone.css" /> 
    <link type="text/css" rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.7/js/dojo/dojox/mobile/themes/buttons.css" /> 
    <link rel="apple-touch-icon" href="apple-touch-icon.png" />
    <style type="text/css">
      html, body
      {
        height: 100%;
        margin: 0px;
        padding: 0px;
        width: 100%;
    }
    </style>
    <script type="text/javascript">
      var djConfig = {
        parseOnLoad: true
      };
    </script>
   <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.7compact"></script> 



Changing the references to 3.2 and added the newer esri.css references gives an error:
_a is undefined
at parse(Object, Object, Array) (http://serverapi.arcgisonline.com/jsapi/arcgis/3.2compact/js/dojo/dojox/mobile/parser.js:2)
<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="format-detection" content="telephone=yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    
    <title>
      Find Nearby WIC Locations
    </title>
      <link type="text/css" rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.2/js/dojo/dojox/mobile/themes/iPhone/iPhone.css" /> 
    <link type="text/css" rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.2/js/dojo/dojox/mobile/themes/buttons.css" /> 
  
    <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.2/js/esri/css/esri.css" /> 
    <link rel="apple-touch-icon" href="apple-touch-icon.png" />
    <style type="text/css">
      html, body
      {
        height: 100%;
        margin: 0px;
        padding: 0px;
        width: 100%;
    }
    </style>
    <script type="text/javascript">
      var djConfig = {
        parseOnLoad: true
      };
    </script>
   <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.2compact"></script> 

Outcomes