This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//dataAPI : 'http://roll.news.sina.com.cn/interface/rollnews_ch_out_interface.php', | |
function Person (name,age,job) { | |
//防止全局作用域意外对象属性 | |
if(this instanceof Person) { | |
this.name = name; | |
this.age = age; | |
this.job = job; | |
} else { | |
return new Person(name,age,job); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var text3 = document.getElementById("text3"); | |
var text2 = document.getElementById("text2"); | |
text2.focus() | |
text2.onfocus = function () { | |
this.select(); | |
} | |
var tips = document.createElement("span"); | |
text3.onselect = function () { | |
//console.log(this.selectionStart,this.selectionEnd) | |
//console.log(this.value.substring(this.selectionStart,this.selectionEnd)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="zh-CN"> | |
<head> | |
<meta charset="UTF-8"> | |
</head> | |
<body id="MF"> | |
<!--header--> | |
<?php $this->load->view('common/header');?> | |
<!-- Container Start --> | |
<div class="container"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//load more | |
(function () { | |
var loadObj = $(".loading-more"), | |
tabModCont = $(".tab-mod-content ul"), | |
tmpl ='', | |
lastBtnPos, | |
i = 1; | |
loadObj.click(function () { | |
i++; | |
lastBtnPos = loadObj.offset().top + $(document.body).scrollTop(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getElement (id) { | |
if(document.getElementById) { | |
return document.getElementById(id); | |
} else if(document.all) { | |
return document.all[id]; | |
} else { | |
throw new Error("No way!") | |
} | |
} | |
function isSortable(object) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<style type="text/css"> | |
#main { | |
border: 10px solid blue !important; | |
} | |
.sty_360 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getQueryStringArgs () { | |
// URL length get "?" before string | |
var qs = (location.search.length > 0 ? location.search.substring(1) : ""), | |
args = {}, | |
//切分成数组 | |
items = qs.length ? qs.split("&") : [], | |
item = null, | |
name = null, | |
value = null, | |
i = 0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function SuperType (name) { | |
this.name = name; | |
this.colors = ['red','blue','green']; | |
} | |
SuperType.prototype.sayName = function () { | |
console.log(this.name); | |
} | |
function SubType(name,age) { | |
SuperType.call(this,name); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Funname () { | |
this.param = param; | |
this.arr = [1,2]; | |
} | |
Funname.prototype = { | |
constuctor: Funname, | |
method : function () { | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ajaxCall() { | |
$("#LoadingImage").show(); | |
$.ajax({ | |
type: "GET", | |
url: "http://api.flickr.com/services/feeds/photos_public.gne?tags=car&tagmode=any&format=json&jsoncallback=?", | |
dataType: "jsonp", | |
success: function(data) { | |
console.log(data); | |
$("#LoadingImage").hide(); | |
}, |