This topic has been archived. It cannot be replied.
-
工作学习 / 学科技术讨论 / javascript问题:代码中的冒号“:”是什么作用?在文档中找不到这样的用法.
-yesiam(party time);
2009-1-9
{160}
(#4972373@0)
-
check JSON. it is something like . in java. Ex: People.run= thisRunFunction(){}
-michaellucad(michaellucad);
2009-1-9
(#4972883@0)
-
果然有高人。再请问一下所有浏览器都直接支持JSON吗?还是要加载一些framework?
-yesiam(party time);
2009-1-12
(#4976841@0)
-
蠢猪,这都不会?不会没关系,Google该会吧?算了,今天大爷我高兴,教你娃两把刷子。新创建一个叫sorttable的对象(object instance 懂不?)。这个对象有三个属性init,makeSortable 和 guessType,并且这三个属性都是函数(function)。调用函数举例:
sorttable.guessType(table, column);
冒号是创建新对象时用来给属性赋值的。例:
var stupidObject = {
name: "yesiam",
nickName: "party time",
age: 21,
gender: "male",
saySomthing: function {
alert("I'm really stupid");
}
};
-forevermore(Forever);
2009-2-11
{295}
(#5043636@0)
-
mark
-anthonylo2008(anthonylo);
2009-2-12
(#5043968@0)
-
你这个sorttable跟后面的stupidObject有什么关系啊?小的要问错了,大爷你莫怪.. 小的自动自觉call 100次stupidObject.saySomething().
-anthonylo2008(anthonylo);
2009-2-12
(#5046075@0)
-
LOL. 没关系。sorttable是他的原例,后面的是我举的蠢例,包括普通属性和函数,更像一个通常用到的对象。
-forevermore(Forever);
2009-2-12
{638}
(#5046358@0)
-
大爷虽然脾气暴躁, 但终归就底还是一个热心肠的人啊
-anthonylo2008(anthonylo);
2009-2-12
(#5046422@0)
-
牛X轰轰的!:-)问你一个问题,试过在一个网页里(no iframe),同时evoke多个ajax calls, 更新多个portlets?
-nicetomeetyou(_);
2009-2-12
(#5046469@0)
-
牛来了!我闪!
-forevermore(Forever);
2009-2-12
(#5046479@0)
-
问题我就没看懂.啥意思您呐?
-nicetoomeetyou(学冠东西);
2009-2-13
(#5046823@0)
-
大板砖尽管砸! 今年我要铺后院. You can only issue ajax call once at a click. that ajax call has to handle refresh for all components you want. Inside one html body, ajax is not designed thread safe !!!initRequest(), req.onreadystatechange,,,, they are all globals.
-nicetomeetyou(_);
2009-2-13
{63}
(#5047304@0)
-
You can only issue ajax call once at a click. -- 为什么?这跟你上面说的又有什么关系?没有那些狗P函数,没有click也能做很多事情。这就是我之前说你“简单问题复杂化”的原因。
-bdbs(别的不算);
2009-2-13
(#5047362@0)
-
+1砖. what i want to do is server dynamically assigns number of to-be-updated portlet's names to a click event when builds a html page, so I want ajax funcs to be written as general as possible, you know framework template is complicated...?when framework is well built, any app can be built by designing style sheets and one can be done within a day. I can then hire designers with basic html skills instead of programmers, who cost more of course.
-nicetomeetyou(_);
2009-2-13
{208}
(#5047375@0)
-
"server dynamically assign ......" AJAX的作用是pull (from the server),不是(server) push (to the client)!
-bdbs(别的不算);
2009-2-13
(#5047387@0)
-
You are so out !!! I am saying dynamically creating ajax code on server side before it was sent to client !!!!
-nicetomeetyou(_);
2009-2-13
(#5047392@0)
-
圈子越绕越大,越绕越远。真是吃饱了撑的。没话讲。
-bdbs(别的不算);
2009-2-13
(#5047439@0)
-
"they are all globals", i feel a little bit different. the reason is the secod callback object overwrite the first one. to fix this, this artical will help.
-c1xwy(洪兴罩俺去战斗);
2009-2-13
(#5047444@0)
-
又要XB自己造的函数库了?唉~~~
-bdbs(别的不算);
2009-2-13
(#5047355@0)
-
you are so mean.
-informix(informix);
2009-2-13
(#5046840@0)
-
保留点幽默感好不好。我看他自己一边写贴子一边在乐呵呵笑着呢。:D
-wangqingshui(忘情水);
2009-2-13
(#5047445@0)
-
In JavaScript, this is called Object literal. A way for creating an object.eg.
var point = { x:0, y:0 }; // Create object point which with 2 properties
So for your codes, it means create a sorttable object, and it has many methods like guessType, makeSortable ....
It is core JavaScript, all major browsers support it.
sorttable = {
init: function() {
.....
},
makeSortable: function(table) {
.....
},
guessType: function(table, column) {
....
},
..
}
-xiaojh(提木霍顿);
2009-2-13
{403}
(#5047526@0)