2005年11月11日
#
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代碼,請高人指點。
<input name="fieldValue" ng-pattern="{{validateRegexp}}" />
$scope.validateRegexp = "/\\d/";
以上代碼,在頁面上可以動態改變validateRegexp的值,頁面上的ng-pattern的內容也確實變了,但卻沒有起作用,有沒有大俠能解釋一下?
1. mysql的數據庫文件存放在哪個位置呢,搞了半天可以在workbanch中執行 show variables like '%datadir%' 命令,結果就出來了
經過一年多拶轉我又即將回到frontend的開發中來,我比以往有了更多的經驗,耐心,專注,比以往更加能規劃自已,現在的前端和幾年前又不一樣了,又多了許多的新東西,我能應付過來么,我相信答案是肯定的,我還能做得更好,加油吧!
想用iframe引用一個網站,但發現該網站做了iframe引用禁止,有沒有辦法能夠讓iframe引用它啊?請教各位牛人了.
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小時,然后做相應的處理,怎樣判斷呢?現在還沒有好的辦法,請教各位牛人們!
現在
1.在介紹你以前的項目時,請重點跟我介紹你在里面做了什么,怎么做,幫原來公司解決了什么,自己收獲了什么,說到底,是你要告訴我你的亮點在哪,別慢舞天際的談。最郁悶就是碰到有一個在介紹項目時讀出一段段的流水賬,做了**模塊,**模塊,**模塊...最后我只明白他告訴我他懂得CRUD,神馬加浮云。
2.因為我們在行業中算是大型的門戶網,對并發要求較高,希望你對性能、并發、分布式等專業領域有一些了解或者研究,哪怕有一些心得也行。
3.在開發方面對struts/spring/hibernate/ibatis等等主流開源框架有一定了解,不要求你一定會哪個,但你選擇了哪個框架,就希望你對這個框架的原理,背后的思想有一定的了解,最好還有業界的評測、認識,不要停留在怎么調用api。
4.“我只負責寫代碼,系統部署運維不關我事”,雖然有些公司是這樣的,但這句話我還是不大喜歡,自己寫的東西運行的狀況如何最起碼要有所了解,不要求你掌握著系統的運維,但起碼要有所參與,對系統環境和部署要比較熟悉,不要只停留在開發寫代碼。
5.對主流的服務應用如nginx/apache/resin/tomcat等等,不要求很懂得調優,但起碼要會玩。
6.簡歷不要跟自己的實際情況差太遠,如果你寫的東西在面試被問到卻說不出個所以然,更會減低別人對你的印象。
今天學習了java ResourceBundle類的內容,但一直還有一個問題沒有解決,就是它讀取資源文件路徑的問題.
以下是我的代碼:
1
package test.resource;
2
3
import java.util.Locale;
4
import java.util.ResourceBundle;
5
6
public 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());方法好像只能讀根路徑下的資源,請教各位了!
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)
最近接觸了jquery,感覺很不錯,以后不用寫這么繁雜的js代碼了,不錯,現在手上又接了個新項目,正好在新項目上邊學邊用了,此文繼續更新中...
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!
以上是僅是我個人的看法,有不對之處請大家多指點!
<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"/>
就都能響應事件
請問這是為什么啊,就想知道為什么?
以下是近期項目碰到的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中接受時要進行相應轉碼.
今天做個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,終于到應該去的地方了.
今天畫線,居然笨到用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顯示出來不會變形
我用的是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>
- found/coin/garden I found a coin in my garden.
- put/sugar/my tea Please put some sugar in my tea.
- cut/wood/fire Cut some woods for fire.
- bought/newspaper I bought a piece of newspaper this morning.
- made/coffee I made a cup of coffee.
- like/curtains in this room I like the curtains in this room.
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 how 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. 
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.
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.
It was two months since I lost my identity card .
My mother told me my new identity card was completed several days ago.
So,I will go home this afternoon.
I will own my new identity card as soon as I arrive at my home.
I got up and looked out of the window this morning,oh,it rained again.
I had breakfast and then went to work.
A lot of people were waiting for the bus at the bus station this morning.
But the traffic was very havey.
We got on the bus after waiting for a long time .
I disliked this weather, because it was very cold.
昨天在網上不經意的在BT上下了一部俄國戰爭影片《第九突擊隊》,沒想到俄國影片會有如此高的素質,影片一開始就緊緊的把人吸引住了,真有點美國大片的感覺,影片主要講俄國在阿富漢的戰爭,
幾個小伙子從新兵訓練營到阿富漢的戰場,到投入戰斗,真的有點寫實,不排除對美國戰爭片的很多引用,特別是到阿富漢飛機舷窗SHENG起來的時候,阿富漢風格的音樂響起,一架武裝直升機在半空中盤弦,更讓人想了JIE他們將ZAO YU到怎樣的阿富漢人,怎么樣的戰斗,,把戰爭除開,阿富漢的山地在影片中,我覺得特別的美,,,唉,可惜有基地在那里,現在沒人GAN去那里旅游...
不過這真是一部值得一看的影片..

I got up very early this morning.
I jogged along the side of the Sahe river.
I felt much colder than before, winter is coming now! so cold.
It is Wednesday, Nov. 16th
Mr. Tao and Mr. Dong are my roommates.
Mr. Tao is one of my roommates. He is 26 years old. He graduated from Sichuan University in 2005.
This is a photograph of Mr.Tao.
He likes English. He always read English loudly every morning,
but he has not a job.
He is finding job now.
Mr. Dong is the orther roommate of mine,
He is 26 years old.
This is a photograph of Mr.Dong.
He graduated from Xichang College in 2001.
He works for YinFeng digital company as a Mp3 plyer salesman.
His company is in the New Century Computer Plaza.
- This is a wonderful garden! What a wonderful garden!
- This is a surprise! What a surprise!
- He is causing a lot of trouble! What a lot of trouble he is causing!
- They are wonderful actors! What wonderful actors they are!
- She is a hard-working woman! What a hard-working woman!
- It is a tall building! What a tall building!
- It's a terrible film! What a terrible film!
- You are a clever boy! What a clever boy you are!
- She is a pretty girl! What a pretty girl she is!
- He is a strange guy! What a strange guy!
全場比賽,無論是控球時間,有威脅的進攻,阿根廷都處于絕對優勢,里克爾梅真的是一位大師級的中場天才,他的傳球,太歷害了..
不過,最后五分鐘,,歐文的兩個頭球,讓阿根廷嘗到了失敗的滋味,歐文全場比賽好像就沒露幾個臉,,最后時刻卻給全場觀眾來了兩個驚喜..不能不說,幾年前的神奇小子又回來了...
快終場時,我還以為我的2:1馬上就會成為現實,,可惜歐文又回來了。。唉!
今晚又將上演舉世囑目的英阿大戰(英格蘭 vs 阿根廷),我當然不用說,我是一名阿根廷的絕對擁護者.
雖然QIE爾西在歐洲是大紅大紫,蘭帕德更被YU為當前歐洲最好的中場球員之一,還有杰拉德也是在去年的冠軍聯賽中大紅大紫,在加上bei帥,和喬科爾等人其中的任何一個,都是世界級的中場搭配.
不過在我看來這個中場在進行攔截上倒是非常有實力的,進攻中有BEI帥精準的長傳,也會有一定的效果,蘭帕德和杰拉德都有很強的遠射能力.但是在控制球方面就可能差很多了(相對阿根廷).可能只有喬科爾或賴特.菲利PU斯還有一定的控帶能力.相比阿根廷隊,中場方面的控制能力就要強很多了,首先是現在佩克爾曼的心腹里克爾梅,他的盤帶能力絕對是世界頂尖級的.然后就是艾馬爾,他也是一位非常有靈氣的中場球員,還有托后一點的索林,他現在絕對是阿根廷隊中的全能型球員,,在中場的控制方面,我看來今晚阿根廷絕對會占很大的優勢.
今晚有一大YI憾便是不能看到18歲的天才球員梅西,如果他能上的話還可以和英格蘭的天才少年LU尼來個大火拼...
英格蘭一定會在穩定后防的前提下先KAO歐文和LU尼的速度打反擊,,這也是2002年world cup上打敗阿根廷的方法,,它的防守倒是比阿根廷有實力,,很難能夠滲透進去,,我想必須要有個人英雄主義的發揮才行,不然很困難..
今晚應該是一場非常精彩的比賽..晚上又要AO夜了...誰叫我喜歡足球呢?
我預測比分 2:1 阿根廷勝
I am a programmer,I worked for a software company of ChengDu as a java engineer.
I met my classmates Zhang Ling and Wang Yong Wen yesterday evening.
We had supper together.We drinked some beer.We chatted with each orther yesterday evening .
Zhang Ling and Wang Yong Wen both work for Agricultural Bank of China, Sichuan Branch.
We graduated from Xi Chang College in July, 2001.
Zhang Ling and Wang Yong Wen both got marraied. 
