p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ASP.NET 3.5 Professionals (http://p2p.wrox.com/forumdisplay.php?f=352)
-   -   Map do not show on Chrome (http://p2p.wrox.com/showthread.php?t=83054)

phuchoang2583 March 25th, 2011 02:53 AM

Map do not show on Chrome
 
Hello everybody

When using Google Chrome I get the "Google Chrome" alert, which occurs after the init function is called, but I never get the f1() function.
If you have any further ideal, please help me

Thanks in advance

function loadXML() {
bounds = new GLatLngBounds();
markerList = [];
map.clearOverlays();
var error = "";
var file = "hotels/MapData.aspx";

try //Internet Explorer
{
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = false;
xmlDoc.load(file);
f1();
}
catch (e)
{
try //Firefox, Mozilla, Opera, etc.
{
xmlDoc = document.implementation.createDocument("", "", null);
xmlDoc.async = false;
xmlDoc.load(file);
f1();
}
catch (e)
{
try //Google Chrome
{
alert("Google Chrome");
var xmlhttp = new window.XMLHttpRequest();
xmlhttp.open("GET", file, false);
xmlhttp.send(null);
xmlDoc.load(file);
xmlDoc = xmlhttp.responseXML.documentElement;
f1();

}
catch (e)
{
error = e.message;
}
}
}


}

chroniclemaster1 April 16th, 2011 12:43 AM

I'm also a JS programmer, and about 4 months ago I started with a new company that uses jQuery for all it's AJAX communications. I hadn't really worked with AJAX much before this, I'm mainly a server side programmer.

I think you would really prefer letting jQuery do all of this fundamental AJAX processing for you, especially since their team of developers has worked out virtually all of the really nasty cross-browser stuff over the course of years. It frees you from learning all that stuff over the next several years before your program will work, and you can just focus on making your program do what you want it to do. The thing I really like about jQuery though is that it doesn't impose any constraints on you. It's just a function library; if there are useful functions that you want to use, you use them. If not, you just write your custom code the way that makes the most sense to you. You're not required to relearn how to do simple things in javascript via some complex new tool (like when you work with CMSs like WordPress or frameworks like drupal).
http://api.jquery.com/jQuery.ajax/


All times are GMT -4. The time now is 09:07 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.