thinking

          one platform thousands thinking

          Type mismatch in IE

          A:
          I am writing an AJAX application.

          Here is a piece of my code:

          http.open("GET", fullURL, true);
          http.onreadystatechange = handleHttpResponse;

          the handleHttpResponse is the function that processes the returned data.

          If I wanted to pass a string in to handleHttpResponse, I use:

          = handleHttpResponse(user_name);

          function handleHttpResponse_remtrip(string) {
          alert(string);
          .. other code ..
          }

          This generates a "Type mismatch" error. What gives?


          B:
          if you do this:

          http.onreadystatechange = handleHttpResponse(user_name);

          then you are assigning the returned value of handleHttpResponse and not the function itself.

          You could try this:

          http.onreadystatechange = createFunc(user_name);

          function createFunc(v) {
          return function() {
          alert(v);
          }
          }

          posted on 2011-01-26 11:35 lau 閱讀(371) 評論(0)  編輯  收藏 所屬分類: Web

          主站蜘蛛池模板: 乐山市| 津市市| 定西市| 大厂| 宜昌市| 册亨县| 双桥区| 邹城市| 灵石县| 济源市| 金阳县| 娱乐| 黑龙江省| 五家渠市| 将乐县| 乐陵市| 永丰县| 英山县| 枣阳市| 方城县| 定安县| 定边县| 平安县| 健康| 平度市| 梅河口市| 色达县| 西峡县| 东丰县| 江源县| 西昌市| 屏南县| 兴安盟| 新营市| 光泽县| 鹤庆县| 托克逊县| 满洲里市| 木兰县| 赣州市| 龙里县|