requirejs 学习笔记 0

require.config({

	waitSeconds : 12,
	paths:{
		jquery : "https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery",
		async : "../js/async", //alias to plugin
		bootstrap : "../js/bootstrap",
		fresh: "../themes/fresh",
		color:"../js/color_module"
	},
	shim : {
		'bootstrap': {deps:['jquery']}	
	}
});

require(['jquery','bootstrap'],function($, _bootstrap){
	
	$("a").tooltip({
      'selector': '',
      'placement': 'top'
    });
    //console.log("Olof");
	//return {};
});

require(['async!http://maps.google.com/maps/api/js?sensor=false', 'fresh'],function(){
    
    var mapDiv = document.getElementById('map');

    var map = new google.maps.Map(mapDiv, {
        center: new google.maps.LatLng(37.4419, -122.1419),
        zoom: 13,
        mapTypeId: google.maps.MapTypeId.ROADMAP,
        navigationControl: true,
        navigationControlOptions: {
            style: google.maps.NavigationControlStyle.SMALL
        },
        styles: gmapFreshStyle
    }); 
});

// require(['color'],function(color){
// 	return color;
// });

主要是尝试一下 requirejs

说不好的感觉 javascript 天生的缺陷 一览无余

google maps api ---> require.js plugin "async!"

bootstrap:tooltip ---> jquery + bootstrap

你可能感兴趣的:(jquery,api,Google,bootstrap,requirejs,tooltip,maps)