display an error alert if service proxy authentifiction failed
[mkws-moved-to-github.git] / experiments / spdemo / index.html
index d9aa838..0954f03 100644 (file)
@@ -7,23 +7,25 @@
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <title>Pazpar2 demo client</title>
   <link rel="stylesheet" href="styles.css"></link>
+  <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.0.min.js"></script>
 
   <!-- pre configure -->
   <script type="text/javascript">
-    var pazpar2URL = "/pazpar2/search.pz2";
-    var serviceProxyURL = "/service-proxy/";
-    var authURLServiceProxy = "/service-proxy-auth";
     var useServiceProxy = true;
-    var pazpar2path = useServiceProxy ? serviceProxyURL : pazpar2URL;
   </script>
 
-  <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.0.min.js"></script>
   <script type="text/javascript" src="pz2.js"></script>
   <script type="text/javascript" src="example_client.js"></script>
 
   <!-- post configure -->
   <script type="text/javascript">
-    $(document).ready(function() { if (useServiceProxy) jQuery.get(authURLServiceProxy) } );
+    $(document).ready(function() { 
+       if (useServiceProxy) { 
+           var jqxhr = jQuery.get(authURLServiceProxy)
+               .fail(function() { alert("service proxy authentifiction failed"); });
+       } 
+      } 
+    );
   </script>
  </head>
  
   
   <div id="footer">
       <div id="stat"></div>
-      <span>Copyright &copy; 1999-2010 by <a href="http://www.indexdata.com">Index Data</a></span> 
+      <span>Copyright &copy; 1999-2013 by <a href="http://www.indexdata.com">Index Data</a></span> 
   </div>
 
  </body>