JavaScript Remote Loading framework: Introduction to JFO Remote Framework 1.0

Source: Internet
Author: User
Tags min aliyun

JFO Remote Framework Version 1.0

Use:

Mainly for remote script embedding, sometimes we may need to embed dynamic scripts in some applications to achieve the data loading or some program control we want, then jforemote may meet our requirements.
Download:

Please copy this link and download the required version according to your needs. Https://github.com/41zone/jfo/tree/master/jforemote

Copyright:

Comply with the MIT Open Source Agreement, the ultimate copyright belongs to Jiuzhang Song (Jimmy song) and the 41zone team, but you can modify and spread.

Version:

There are two versions available, Jforemote-min.js and jforemote-noajax-min.js. The former has canonical Ajax capabilities, including the request and Jsonp two methods, for practical applications may be JSONP for a greater use, because often to deal with cross domain situation, and if the Jsonp method, That means that you can only transmit remotely via get.
Use:

First step. The first thing you have to do is import jforemote into your project, essentially copying a piece of code, For example, we use jforemte-min.js, then we need to copy this code, here you can refer to the code inside Jforemote-demo.js, while the original code for Jforemote to understand what it means, and know how to operate. Here is the link, https://github.com/41zone/jfo/blob/master/jforemote/1.0/jforemote-demo.js

The original code is as follows:

/**

* JFO Remote framework,some question for email ' jimmy.song@aliyun.com '

* Declare:this framework of Javascript developed by 41zone

* License:mit

*/

(function (j) {window.console=window.console| | {Log:function (a) {}};var h= ...)

({}); To add your own logic to handle here

Step two. Write your own actual operation code snippet as required.

Add your own logic after the code:

/**

* JFO Remote framework,some question for email ' jimmy.song@aliyun.com '

* Declare:this framework of Javascript developed by 41zone

* License:mit

*/

(function (j) {window.console=window.console| | {Log:function (a) {}};var h= ...)

Note the following code

({

Ready:true,

styles:[' http://static.41zone.cc/jfo/css/jforemote.css ', ' http://github.com/jfo/common/css/jfo.css '],

scripts:[' Http://static.41zone.cc/jfo/js/jfo-min.js ',

{url: ' http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js ', Conflict: ' $ ', force:true}],

Begin:function (remote) {console.log (' Hello jfo, jforemote begin to work, there are no any scripts and styles being loaded. ');

Success:function (remote) {

$ (remote.div). html (' HELLO JFO, JFO remote loaded! We can do something. ');

Alert (remote.params.name+ ' = ' +remote.query.name);

Remote.jsonp (' Http://dynamic.41zone.cc/jsonp.html?name=jfo ', function (data) {console.log (' result = ' +data.name);});

}

});

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/script/

Related Article

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.