Sea Modular require

Source: Internet
Author: User

On GitHub, find a sea.js modular project, read the source when there is a place that does not understand:

In the Demo.js

Definefunction(Require, exports, module) {varJQuery = require ("jquery-2.0.3"); varv = require ('.. /base/version '); varD = require (' Util/convert/date '); varm = require (' Util/map/baidu-map '); Require (' Sweetalert '); Console.log ("Enter:", module.id); var$output = $ (' #output '); $('. Title ', $output). html (V.desc + "-" +v.version); $('. Version-info DT ', $output). html (V.powerby); $('. Version-info dd ', $output). HTML ("This is written by Seajs referencing jquery. "); $(' #output '). On (' click ',function() {Swal ("Version number:" + v.version + "\ n" + "" + V.powerby + "\ n" + "Introduction:" +V.desc);    }); SetInterval (function() {        $(' #nowDate '). HTML (D.dateformat (' + (NewDate ()), ' Yyyy-mm-dd hh:mm:ss ')); }, 1000); /*----Get geolocation coordinates Start----*/    varOptions ={enablehighaccuracy:true, Maximumage:1000    }    //navigator.geolocation Getting coordinates    if(navigator.geolocation) {Console.log ("Browser Support Geolocation");    Navigator.geolocation.getCurrentPosition (onsuccess, OnError, Options); } Else{Console.log ("Browser does not support geolocation"); }    //when the coordinates are obtained successfully    functiononsuccess (position) {varlongitude = position.coords.longitude;//Longitude        varlatitude = position.coords.latitude;//Latitudeconsole.log (longitude, latitude); M.initmap (' Map ', longitude, latitude);//Initialize MapM.addmarker (longitude, latitude);//Add Overlay}

Sea Modular require

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.