<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    I'm happy to live!

    Develop with pleasure!

      BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
      39 隨筆 :: 2 文章 :: 31 評論 :: 0 Trackbacks

    2005年11月21日 #

         chrome,firefox下面運行都很正常,唯獨在safari下會爆SyntaxError: DOM Exception 12錯誤:
     [Error] Error: SyntaxError: DOM Exception 12
    setRequestHeader@[native code]
    http://localhost:8989/app/js/base.js:40967:27
    http://localhost:8989/app/js/base.js:19014:33
    forEach@http://localhost:8989/app/js/base.js:9537:24
    http://localhost:8989/app/js/base.js:19012:14
    sendReq@http://localhost:8989/app/js/base.js:18873:21
    serverRequest@http://localhost:8989/app/js/base.js:18589:23
    processQueue@http://localhost:8989/app/js/base.js:22454:29
    http://localhost:8989/app/js/base.js:22470:39
    $eval@http://localhost:8989/app/js/base.js:23672:28
    $digest@http://localhost:8989/app/js/base.js:23488:36
    $apply@http://localhost:8989/app/js/base.js:23777:31
    bootstrapApply@http://localhost:8989/app/js/base.js:10661:21
    invoke@http://localhost:8989/app/js/base.js:13409:22
    doBootstrap@http://localhost:8989/app/js/base.js:10659:20
    bootstrap@http://localhost:8989/app/js/base.js:10679:23
    angularInit@http://localhost:8989/app/js/base.js:10573:14
    http://localhost:8989/app/js/base.js:35510:16
    fire@http://localhost:8989/app/js/base.js:3094:35
    fireWith@http://localhost:8989/app/js/base.js:3206:11
    ready@http://localhost:8989/app/js/base.js:3412:24
    completed@http://localhost:8989/app/js/base.js:3428:14
     


    這是個什么error?沒見過baidu一下有了:

    DOMException是W3C DOM核心對象。
    DOMException接口表示一個處理的錯誤,當一個操作不可能執行的時候,會拋出一個異常。
    例如試圖創建一個無效的DOM, 或通過一個不存在的節點作為參數節點操作方法。

    SYNTAX_ERR code 12 --> 無效或非法的字符串被指定。

    具休介紹可以到些鏈接查看: http://www.zhangxinxu.com/wordpress/2012/05/w3c-dom-domexception-object/

    先從error stack中找到出錯的地方,在angular-file-upload-all.js中的以下位置:
     1 var key, i;
     2 function patchXHR(fnName, newFn) {
     3     window.XMLHttpRequest.prototype[fnName] = newFn(window.XMLHttpRequest.prototype[fnName]);
     4 }
     5 
     6 if (window.XMLHttpRequest && !window.XMLHttpRequest.__isFileAPIShim) {
     7     patchXHR('setRequestHeader', function (orig) {
     8         return function (header, value) {
     9             if (header === '__setXHR_') {
    10                 var val = value(this);
    11                 // fix for angular < 1.2.0
    12                 if (val instanceof Function) {
    13                     val(this);
    14                 }
    15             } else {
    16                 orig.apply(this, arguments);
    17             }
    18         }
    19     });
    20 }

    出錯的位置在第16行,把header打出來看了一下,Authorization的值是這樣的'Token '的,后面多了一個空格,果斷刪除掉空格再試,不爆錯了,原來是空格惹的禍,為什么會出錯呢,想去看看這個orig的內容是什么,可碰到[native code],這個估計是c++的code,這個要如何看得到內容呢,問題是解決了,但還未探清問題的源頭,又是c代碼,請高人指點。 
    posted @ 2015-12-17 17:04 Norsor 閱讀(1970) | 評論 (0)編輯 收藏

    <input name="fieldValue" ng-pattern="{{validateRegexp}}" />
    $scope.validateRegexp = "/\\d/";
    以上代碼,在頁面上可以動態改變validateRegexp的值,頁面上的ng-pattern的內容也確實變了,但卻沒有起作用,有沒有大俠能解釋一下?
    posted @ 2015-10-21 13:10 Norsor 閱讀(2928) | 評論 (0)編輯 收藏

    1. mysql的數據庫文件存放在哪個位置呢,搞了半天可以在workbanch中執行 show variables like '%datadir%'  命令,結果就出來了
    posted @ 2015-07-01 10:50 Norsor 閱讀(3933) | 評論 (0)編輯 收藏

        經過一年多拶轉我又即將回到frontend的開發中來,我比以往有了更多的經驗,耐心,專注,比以往更加能規劃自已,現在的前端和幾年前又不一樣了,又多了許多的新東西,我能應付過來么,我相信答案是肯定的,我還能做得更好,加油吧!
    posted @ 2015-04-29 13:42 Norsor 閱讀(4643) | 評論 (0)編輯 收藏

    想用iframe引用一個網站,但發現該網站做了iframe引用禁止,有沒有辦法能夠讓iframe引用它啊?請教各位牛人了.

    posted @ 2012-11-15 17:43 Norsor 閱讀(1507) | 評論 (0)編輯 收藏

         摘要: DIV在FF下的拖動  閱讀全文
    posted @ 2011-10-30 09:37 Norsor 閱讀(1932) | 評論 (3)編輯 收藏

     

    DateFormat df = DateFormat.getDateTimeInstance(DateFormat.MEDIUM,
                    DateFormat.SHORT,Locale.CANADA);
            TimeZone tz 
    = TimeZone.getTimeZone("America/Los_Angeles");

            df.setTimeZone(tz);
            String time 
    = df.format(new Date());
            System.out.println(time);
    如上代碼,我構造DateFormat的格式,然后會傳入用戶所選擇的Locale,可能是CANADA,US,CHINA,FRANCH....不同的Locale產生的時間格式不同,比如:
    20-Jan-2011 5:35 AM   (Locale.CANADA)
    Jan 20, 2011 5:38 AM(Locale.US)
    Jan 20, 2011 5:39 AM(Locale.ENGLISH)
    20 janv. 2011 05:39(Locale.FRANCH)
    20.01.2011 05:40(Locale.GERMAN)
    2011-1-20 上午5:42(Locale.CHINA)
    2011. 1. 20 ?? 5:43(Locale.KOREA)
    ...等等..

    現在這些格式中有的是24小時制顯示的,有的是12小時制顯示的,我現在想判斷每一種Locale是什么時間制,是24還是12小時,然后做相應的處理,怎樣判斷呢?現在還沒有好的辦法,請教各位牛人們!
    現在
    posted @ 2011-01-20 21:46 Norsor 閱讀(1993) | 評論 (0)編輯 收藏

        在我的項目中,用戶會選擇自已的時區,所以顯示的時間都是根據用戶選擇的時區來顯示時間的,而時間我存入數據庫時我打算是轉成格林威治時間,然后從庫里取出時間后又根據用戶的選擇來轉成對應時區的時間
    但現在卻碰到一些問題,如何將對應時區的時間轉成格林威治時間呢?

    以下是我的部分代碼:
    DateFormat df = DateFormat.getDateTimeInstance(DateFormat.LONG,
                    DateFormat.LONG);
            Calendar cal 
    = Calendar.getInstance();

            TimeZone tz 
    = TimeZone.getTimeZone("America/Los_Angeles");

            df.setTimeZone(tz);
            String time 
    = df.format(new Date());
            System.out.println(time);
            Date date 
    = df.parse(time, new ParsePosition(0));
            System.out.println(date);
    為何df.parse()后返回的date又成了當前系統的時間了啊,我如何把當前用戶時區的時間轉換成格林威治時間呢,謝謝牛人們?
    posted @ 2011-01-05 07:31 Norsor 閱讀(1697) | 評論 (3)編輯 收藏

    1.在介紹你以前的項目時,請重點跟我介紹你在里面做了什么,怎么做,幫原來公司解決了什么,自己收獲了什么,說到底,是你要告訴我你的亮點在哪,別慢舞天際的談。最郁悶就是碰到有一個在介紹項目時讀出一段段的流水賬,做了**模塊,**模塊,**模塊...最后我只明白他告訴我他懂得CRUD,神馬加浮云。 2.因為我們在行業中算是大型的門戶網,對并發要求較高,希望你對性能、并發、分布式等專業領域有一些了解或者研究,哪怕有一些心得也行。 3.在開發方面對struts/spring/hibernate/ibatis等等主流開源框架有一定了解,不要求你一定會哪個,但你選擇了哪個框架,就希望你對這個框架的原理,背后的思想有一定的了解,最好還有業界的評測、認識,不要停留在怎么調用api。 4.“我只負責寫代碼,系統部署運維不關我事”,雖然有些公司是這樣的,但這句話我還是不大喜歡,自己寫的東西運行的狀況如何最起碼要有所了解,不要求你掌握著系統的運維,但起碼要有所參與,對系統環境和部署要比較熟悉,不要只停留在開發寫代碼。 5.對主流的服務應用如nginx/apache/resin/tomcat等等,不要求很懂得調優,但起碼要會玩。 6.簡歷不要跟自己的實際情況差太遠,如果你寫的東西在面試被問到卻說不出個所以然,更會減低別人對你的印象。
    posted @ 2010-12-29 22:47 Norsor 閱讀(464) | 評論 (1)編輯 收藏

    今天學習了java ResourceBundle類的內容,但一直還有一個問題沒有解決,就是它讀取資源文件路徑的問題.

    以下是我的代碼:
     1package test.resource;
     2
     3import java.util.Locale;
     4import java.util.ResourceBundle;
     5
     6public class Test {
     7    public static void main(String args[]) {
     8        Test test = new Test();
     9        ResourceBundle messages = test.loadResource();
    10        System.out.println(messages.getObject("name"));
    11    }

    12
    13    private ResourceBundle loadResource() {
    14        Locale local = Locale.getDefault();
    15        ResourceBundle messages = ResourceBundle.getBundle("messages", local,
    16                this.getClass().getClassLoader());
    17        return messages;
    18    }

    19}
     我的兩個資源文件messages_en_US.properties,messages_zh_CN.properties都在當前類路徑下面,可是這樣的話運行程序它就找不到資源文件,會報錯:Can't find bundle for base name messages, locale zh_CN
    我必需把兩個資源文件copy到classes根目錄下才行,我想資源文件是可以放在當前類路徑下面的,可是不太清楚如何讀取出來,ResourceBundle.getBundle("messages", local,
        this.getClass().getClassLoader());方法好像只能讀根路徑下的資源,請教各位了!
    posted @ 2010-12-26 18:37 Norsor 閱讀(12355) | 評論 (2)編輯 收藏

    MySQL中的定時執行

     

      查看event是否開啟

      show variables like '%sche%';

      將事件計劃開戶

      set global event_scheduler =1;

     

      創建存儲過程test

      CREATE PROCEDURE test ()
      BEGIN
      update examinfo SET endtime = now() WHERE id = 14;
      END;

     

      創建event e_test

      create event if not exists e_test
      on schedule every 30 second
      on completion preserve
      do call test();

     

      每隔30秒將執行存儲過程test,將當前時間更新到examinfo表中id=14的記錄的endtime字段中去.

     

      關閉事件任務

      alter event e_test ON
      COMPLETION PRESERVE DISABLE;

     

      開戶事件任務
      alter event e_test ON
      COMPLETION PRESERVE ENABLE;

     

      以上測試均成功,測試環境為mysql 5.4.2-beta-community mysql community server(GPL)

    posted @ 2009-11-20 00:25 Norsor 閱讀(1381) | 評論 (2)編輯 收藏

    最近接觸了jquery,感覺很不錯,以后不用寫這么繁雜的js代碼了,不錯,現在手上又接了個新項目,正好在新項目上邊學邊用了,此文繼續更新中...

    posted @ 2009-11-09 23:43 Norsor 閱讀(233) | 評論 (0)編輯 收藏

        
        Ajax也用了很長時間了,今天只是想整理一下我心中的Ajax.
        簡單的說Ajax就是實現了異步向服務器請求數據,讓用戶有更好的體驗.
        XMLHttpRequest其實也就只有兩種方式返回請求后的數據:

        1.responseText方式,它是返回文本字串的方式,其實采用這種方式,通常是在服務端在對請求響應處理后,生成好要在瀏覽器上展示的html代碼后,再直接輸出到客戶端,更新需要更新的客戶端頁面內容.這種方式的好處是能在服務端生成好客戶端代碼,可減輕客戶端的負擔,客戶端只需將服務端生成的代碼innerHTML到對應的區域就行了... ...  但它的缺點在于,輸出到客戶端的是文本數據,所以無法對得到的數據在客戶端進行處理,所以就難以行成根據取回的數據的差異對頁面進行必要的邏輯處理.

        2.responseXML方式,它是返回XML格式的文本,它是在服務端在對請求響應處理后,將數據以XML格式的文本返回到客戶瀏覽器上,然后再由客戶端來完成方式1中由服務端來完成的生成頁面展示的內容. 客戶端將解析返回的XML數據,然后再進行頁面的展示,由于是XML數據所以可以進行解析便可以根據解析出的數據對如何展示頁面進行邏輯處理,在這一點上是比responseText要靈活的.但付出的是加大了客戶端的負擔.

        其實現在我正在學習JSON,如果在responseText方式中返回JSON方式的數據的話,是完全可以讓responseText和responseXML一樣的靈活的,因為JSON也是一種數據結構,可以將要返回的數據組織在其中,到客戶端再進行解析,解析也相當簡單,只需evel執行即可...  但前提是輸出到客戶端的JSON數據結構是正確的,不然js就會bomb!

        以上是僅是我個人的看法,有不對之處請大家多指點!
    posted @ 2009-07-26 22:49 Norsor 閱讀(2178) | 評論 (5)編輯 收藏




    <IMG onclick="go()" ID="sphere" SRC="tt.jpg" STYLE="position:absolute;filter:fliph;clip=rect(100 170 140 70)"/>
    這樣以后,無法響應onclick事件,試了其它事件,好像都不能響應了,
    如果改成:
    <IMG onclick="go()" ID="sphere" SRC="tt.jpg" STYLE="position:absolute;clip=rect(100 170 140 70)"/>

    <IMG onclick="go()" ID="sphere" SRC="tt.jpg" STYLE="position:absolute;filter:fliph"/>
    就都能響應事件
    請問這是為什么啊,就想知道為什么?
    posted @ 2009-07-16 09:40 Norsor 閱讀(759) | 評論 (0)編輯 收藏

    以下是近期項目碰到的ajax的一些問題列舉出來供大家分享,希望有所幫助,還在不斷增加中:

    1.ajax,action中response返回的xml文檔格式錯誤時,eclipse debug進入不到action中.

    2.ajax緩存問題,需要加入xmlHttp.setRequestHeader("If-Modified-Since","0");便可解決.

    3.如果不是ajax提交,而設置了PrintWriter out = response.getWriter();則jsp會產生中文亂碼.

    4.ajax返回xml亂碼的原因
    response.setContentType("text/xml;charset=GBK");
    PrintWriter out = response.getWriter();
    這樣才起作用,如果這樣:
    PrintWriter out = response.getWriter();
    response.setContentType("text/xml;charset=GBK");
    那么response.setContentType("text/xml;charset=GBK");就不起作用了所以返回是亂碼,這個問題搞了很久,代碼還得仔細看啊.

    5.ajax表單提交
    xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    由于傳過去的是utf-8編碼的,所以在action 或servlet中接受時要進行相應轉碼.

     

    posted @ 2009-05-09 15:26 Norsor 閱讀(1621) | 評論 (1)編輯 收藏

    今天做個spring和struts的集成Demo,我用的是myeclipse6.5,導入spring框架和struts框架都相當方便,一切就序后,開tomcat,跑吧,相當的不爽,第一個鏈接就爆: servlet action is not available,什么意思啊,難道我的配置文件沒配對?檢查了沒天也沒發現什么問題.
    以下是我的struts  的struts-config.xml:
    <struts-config>
        
    <data-sources />
        
    <form-beans />
        
    <global-exceptions />
        
    <global-forwards />

        
    <action-mappings>
            
    <action path="/hello" type="com.laxxx.struts.action.Hello">
                
    <forward name="hello" path="/hello.jsp" />
            
    </action>
        
    </action-mappings>

        
    <controller
            
    processorClass="org.springframework.web.struts.DelegatingRequestProcessor" />


        
    <message-resources
            
    parameter="com.laxxx.struts.ApplicationResources" />


        
    <plug-in
            
    className="org.springframework.web.struts.ContextLoaderPlugIn">

            
        
    <set-property property="contextConfigLocation"
                value
    ="/WEB-INF/applicationContext.xml" />
        
    </plug-in>
    </struts-config>

    以下是spring的applicationContext.xml:
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi
    ="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation
    ="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">

        
    <bean name="/hello" class="com.laxxx.struts.action.Hello">

        
    </bean>
    </beans>

    看了又看找了又找,還是沒看出問題,把struts-config中關于spring兩段配置去掉后,單跑struts是沒問題的,看來很有可能myeclipse沒把包導全啊,可能沒找到,發現好多人都中過此招,有些包沒找到spring的代理請求處理類或者是沒找到初始化spring上下文的插件類,這兩個類都在spring.jar中,于是把這個jar包放入lib目錄中去,重啟tomcat... ... 再點,ok,終于到應該去的地方了.
    posted @ 2008-12-04 17:19 Norsor 閱讀(562) | 評論 (0)編輯 收藏

    今天畫線,居然笨到用ps做圖來做td的背景在html中當成線條,同事一提醒才知道html中還有個fieldset-->legend標簽,就是用來顯示線框的,唉,居然從來沒用過,不過學到了哈.
    <fieldset>
      
    <legend>
        Infomation
      
    </legend>
      height:180cm
    </fieldset>

    還有個標記<pre>可以保持文本原本的格式:
    <pre>
    for(int i = 0;i 
    < 10;i ++){
      System.out.println("goal");
    }
    </pre
    >
    以上代碼在html顯示出來不會變形
    posted @ 2008-10-30 23:06 Norsor 閱讀(1521) | 評論 (5)編輯 收藏

    我用的是webwork最新版本2.2,,
    在頁面上輸入姓名后提交到helloWorld.action,到一個新的頁面,可interceptor不起作用,所以早前輸入的name值也為null.
    可不知為什么interceptor不起作用,請大家幫幫忙,這個問題困擾我一個星期了..還是沒能解決..

    Tomcat不報錯,但顯示如下信息:
    請各位大俠幫幫忙啊,小弟先謝了...

    2005-12-5 17:13:32 com.opensymphony.xwork.config.providers.XmlConfigurationProvider verifyInterceptor
    嚴重: Unable to load class com.opensymphony.xwork.spring.interceptor.ActionAutowiringInterceptor for interceptor name au
    towiring. This interceptor will not be available.
    Cause: Could not load class com.opensymphony.xwork.spring.interceptor.ActionAutowiringInterceptor. Perhaps it exists but
    certain dependencies are not available?
    2005-12-5 17:13:32 com.opensymphony.xwork.config.providers.InterceptorBuilder constructInterceptorReference
    嚴重: Unable to find interceptor class referenced by ref-name completeStack


    我的xwork.xml內容如下:

    <xwork>
    <include file="webwork-default.xml"/>

    <package name=
    "default" extends="webwork-default">
    <!-- Include webwork defaults (from WebWork JAR). -->
    <default-interceptor-ref name=
    "completeStack"/>

    <action name=
    "helloWorld"
    class=
    "test.HelloWorldAction">
    <result name=
    "success">hello.jsp</result>
    <result name=
    "input">name.jsp</result>
    </action>
    </package>
    </xwork>
    posted @ 2005-12-05 19:31 Norsor 閱讀(1071) | 評論 (1)編輯 收藏

    1. found/coin/garden                      I found a coin in my garden.
    2. put/sugar/my tea                         Please put some sugar in my tea.
    3. cut/wood/fire                              Cut some woods for fire.
    4. bought/newspaper                      I bought a piece of newspaper this morning.
    5. made/coffee                                I made a cup of coffee.
    6. like/curtains in this room         I like the curtains in this room.
    posted @ 2005-11-25 10:18 Norsor 閱讀(437) | 評論 (1)編輯 收藏

    I have been browsing website of the Apache Software Foundation the whole day.
    The Apache Software Foundation is an opensource organization of java, and it has many projects and subprojects, such as Tomcat,Struts,Logging,Web Service and Httpclient.
    This organization has many volunteers from all over the world, they contribute their achievements to this organization.
    The orgznization has developed rapidly.
    I thouht h
    ow  I can share my achievements with them?
    I know  now.
    The organization has a community on it's website.
    I thought I can learned a lot of knowledge of java  here. 

    posted @ 2005-11-23 23:11 Norsor 閱讀(328) | 評論 (0)編輯 收藏


    Up to now,my classmate Tao Wei has not found his purse.
    There are 30$,a identity  card and some credit cards in his purse,Mrs Tao was very unhappy.
    He wont to remember what he has done the whole day.
    I  lost my purse  two months ago,there were 200$ , a identity card and 3 credit cards in my purse.
    So,I understood Mrs Tao's feeling now.

    posted @ 2005-11-22 19:49 Norsor 閱讀(226) | 評論 (0)編輯 收藏

    I  returned Chengdu yesterday evening.
    I brought some cloth for winter from my home.
    My hometown  is  Eemei, it's to the south of Chengdu,it's a beautiful small city,I was born and studied there,
    I got on the bus at  Eemei bus station at  6:00 yesterday evening.
    I have been sleeping on my way to Chengdu.
    I  arrived at Chengdu station after tow hours.
    I carried  a very heavy bag,that's why I went to my department by taxicab istead of by bus.
    I have  been tired ,up to now,so I wanted to have a rest.
    I saw my mother ,my father , my  sister-in-law and my nephew.
    They looked fine,my nephew was taller  than before,He is very lovely.
    posted @ 2005-11-21 11:36 Norsor 閱讀(355) | 評論 (0)編輯 收藏

    主站蜘蛛池模板: 国产乱色精品成人免费视频 | 久久精品无码专区免费| 日本免费v片一二三区| 亚洲最大无码中文字幕| 成人免费无码大片a毛片软件| 亚洲一欧洲中文字幕在线| 麻豆一区二区免费播放网站| 亚洲图片校园春色| 久久精品女人天堂AV免费观看| 国产精品亚洲片夜色在线| 国产在线国偷精品产拍免费| 亚洲av无码一区二区三区人妖 | 青青青国产色视频在线观看国产亚洲欧洲国产综合 | 18禁男女爽爽爽午夜网站免费| 91亚洲一区二区在线观看不卡 | 国产精品成人四虎免费视频| 国产AV无码专区亚洲AV麻豆丫 | 嘿嘿嘿视频免费网站在线观看| 亚洲激情视频图片| 狼友av永久网站免费观看| 国产亚洲视频在线播放大全| 亚洲色自偷自拍另类小说| 精品无码AV无码免费专区| 亚洲国产精品综合久久20| 四虎亚洲国产成人久久精品| 你懂的网址免费国产| 亚洲性一级理论片在线观看| 免费羞羞视频网站| 精品国产福利尤物免费| 亚洲欧洲自拍拍偷综合| 成人免费无遮挡无码黄漫视频| 国产成人精品免费视频大全| 7777久久亚洲中文字幕蜜桃| 成年女性特黄午夜视频免费看| 一级成人毛片免费观看| 亚洲国产综合精品| 亚洲日韩VA无码中文字幕| 18以下岁毛片在免费播放| 黄页网站在线免费观看| 久久精品国产亚洲精品2020| 国产乱子伦精品免费无码专区|