'ITWeb/개발일반'에 해당되는 글 489건
- 2011.10.06 JSFIDDLE
- 2011.10.06 구글의 자바스크립트 엔진 V8
- 2011.10.05 [LINK] I'm Alex Russell, a web developer working on Chrome Frame and the broader web platform at Google. I'm guilty of many JavaScript transgressions.
- 2011.09.29 [펌] div resizable
- 2011.09.29 yui javascript compressor/scrambler
- 2011.09.28 나라별 IP 존 정보 구하기
- 2011.09.28 Ad Network - inmobi, mojiva
- 2011.09.21 Interactive Advertising Bureau
- 2011.09.09 이클립스 컬러 테마
- 2011.09.07 http get length
구글의 자바스크립트 엔진 V8
ITWeb/개발일반 2011. 10. 6. 09:33옛날부터 자바스크립트 엔진 개발에 관심이 있었으나 먹고 살기 바쁘다는 핑계로 그냥 눈팅만 했었는데..
과연 앞으로도 잘 할 수 있을지 모르겠다..ㅡ.ㅡ;;
http://code.google.com/p/v8/
http://code.google.com/p/v8/source/checkout
구글의 V8 을 분석해보기로 하자..
[LINK] I'm Alex Russell, a web developer working on Chrome Frame and the broader web platform at Google. I'm guilty of many JavaScript transgressions.
ITWeb/개발일반 2011. 10. 5. 13:44[펌] div resizable
ITWeb/개발일반 2011. 9. 29. 09:19ref. http://webfx.eae.net/dhtml/genresize/genresize.html
///////////////////////////////////////////////////////////////////////// // Generic Resize by Erik Arvidsson // // // // You may use this script as long as this disclaimer is remained. // // See www.dtek.chalmers.se/~d96erik/dhtml/ for mor info // // // // How to use this script! // // Link the script in the HEAD and create a container (DIV, preferable // // absolute positioned) and add the class="resizeMe" to it. // ///////////////////////////////////////////////////////////////////////// var theobject = null; //This gets a value as soon as a resize start function resizeObject() { this.el = null; //pointer to the object this.dir = ""; //type of current resize (n, s, e, w, ne, nw, se, sw) this.grabx = null; //Some useful values this.graby = null; this.width = null; this.height = null; this.left = null; this.top = null; } //Find out what kind of resize! Return a string inlcluding the directions function getDirection(el) { var xPos, yPos, offset, dir; dir = ""; xPos = window.event.offsetX; yPos = window.event.offsetY; offset = 8; //The distance from the edge in pixels if (yPos<offset) dir += "n"; else if (yPos > el.offsetHeight-offset) dir += "s"; if (xPos<offset) dir += "w"; else if (xPos > el.offsetWidth-offset) dir += "e"; return dir; } function doDown() { var el = getReal(event.srcElement, "className", "resizeMe"); if (el == null) { theobject = null; return; } dir = getDirection(el); if (dir == "") return; theobject = new resizeObject(); theobject.el = el; theobject.dir = dir; theobject.grabx = window.event.clientX; theobject.graby = window.event.clientY; theobject.width = el.offsetWidth; theobject.height = el.offsetHeight; theobject.left = el.offsetLeft; theobject.top = el.offsetTop; window.event.returnValue = false; window.event.cancelBubble = true; } function doUp() { if (theobject != null) { theobject = null; } } function doMove() { var el, xPos, yPos, str, xMin, yMin; xMin = 8; //The smallest width possible yMin = 8; // height el = getReal(event.srcElement, "className", "resizeMe"); if (el.className == "resizeMe") { str = getDirection(el); //Fix the cursor if (str == "") str = "default"; else str += "-resize"; el.style.cursor = str; } //Dragging starts here if(theobject != null) { if (dir.indexOf("e") != -1) theobject.el.style.width = Math.max(xMin, theobject.width + window.event.clientX - theobject.grabx) + "px"; if (dir.indexOf("s") != -1) theobject.el.style.height = Math.max(yMin, theobject.height + window.event.clientY - theobject.graby) + "px"; if (dir.indexOf("w") != -1) { theobject.el.style.left = Math.min(theobject.left + window.event.clientX - theobject.grabx, theobject.left + theobject.width - xMin) + "px"; theobject.el.style.width = Math.max(xMin, theobject.width - window.event.clientX + theobject.grabx) + "px"; } if (dir.indexOf("n") != -1) { theobject.el.style.top = Math.min(theobject.top + window.event.clientY - theobject.graby, theobject.top + theobject.height - yMin) + "px"; theobject.el.style.height = Math.max(yMin, theobject.height - window.event.clientY + theobject.graby) + "px"; } window.event.returnValue = false; window.event.cancelBubble = true; } } function getReal(el, type, value) { temp = el; while ((temp != null) && (temp.tagName != "BODY")) { if (eval("temp." + type) == value) { el = temp; return el; } temp = temp.parentElement; } return el; } document.onmousedown = doDown; document.onmouseup = doUp; document.onmousemove = doMove;
yui javascript compressor/scrambler
ITWeb/개발일반 2011. 9. 29. 09:18yui compresson : http://developer.yahoo.com/yui/compressor/
http get length
ITWeb/개발일반 2011. 9. 7. 14:49ref. http://www.boutell.com/newfaq/misc/urllength.html
Microsoft Internet Explorer (Browser)
Microsoft states that the maximum length of a URL in Internet Explorer is 2,083 characters, with no more than 2,048 characters in the path portion of the URL. In my tests, attempts to use URLs longer than this produced a clear error message in Internet Explorer.
Firefox (Browser)
After 65,536 characters, the location bar no longer displays the URL in Windows Firefox 1.5.x. However, longer URLs will work. I stopped testing after 100,000 characters.
Safari (Browser)
At least 80,000 characters will work. I stopped testing after 80,000 characters.
Opera (Browser)
At least 190,000 characters will work. I stopped testing after 190,000 characters. Opera 9 for Windows continued to display a fully editable, copyable and pasteable URL in the location bar even at 190,000 characters.
Apache (Server)
My early attempts to measure the maximum URL length in web browsers bumped into a server URL length limit of approximately 4,000 characters, after which Apache produces a "413 Entity Too Large" error. I used the current up to date Apache build found in Red Hat Enterprise Linux 4. The official Apache documentation only mentions an 8,192-byte limit on an individual field in a request.
Microsoft Internet Information Server
The default limit is 16,384 characters (yes, Microsoft's web server accepts longer URLs than Microsoft's web browser). This is configurable.
Perl HTTP::Daemon (Server)
Up to 8,000 bytes will work. Those constructing web application servers with Perl's HTTP::Daemon module will encounter a 16,384 byte limit on the combined size of all HTTP request headers. This does not include POST-method form data, file uploads, etc., but it does include the URL. In practice this resulted in a 413 error when a URL was significantly longer than 8,000 characters. This limitation can be easily removed. Look for all occurrences of 16x1024 in Daemon.pm and replace them with a larger value. Of course, this does increase your exposure to denial of service attacks.
Recommendations
Extremely long URLs are usually a mistake. URLs over 2,000 characters will not work in the most popular web browser. Don't use them if you intend your site to work for the majority of Internet users.
When you wish to submit a form containing many fields, which would otherwise produce a very long URL, the standard solution is to use the POST method rather than the GET method:
The form fields are then transmitted as part of the HTTP transaction body, not as part of the URL, and are not subject to the URL length limit. Short-lived information should not be stored in URLs.
As a rule of thumb, if a piece of information isn't needed to regenerate the same page as a result of returning to a favorite or bookmark, then it doesn't belong in the URL.
The Bookmark Problem
In very rare cases, it may be useful to keep a large amount of "state" information in a URL. For instance, users of a map-navigating website might wish to add the currently displayed map to their "bookmarks" or "favorites" list and return later. If you must do this and your URLs are approaching 2,000 characters in length, keep your representation of the information as compact as you can, squeezing out as much "air" as possible. If your field names take up too much space, use a fixed field order instead. Squeeze out any field that doesn't really need to be bookmarked. And avoid large decimal numbers - use only as much accuracy as you must, and consider a base-64 representation using letters and digits (I didn't say this was easy).
In extreme cases, consider using the gzip algorithm to compress your pretty but excessively long URL. Then reencode that binary data in base64 using only characters that are legal in URLs. This can yield a 3-4x space gain, at the cost of some CPU time when you unzip the URL again on the next visit. Again, I never said it was easy!
An alternative is to store the state information in a file or a database. Then you can store only the identifier needed to look up that information again in the URL. The disadvantage here is that you will have many state files or database records. Some of which might be linked to on websites run by others. One solution to this problem is to delete the state files or database records for the URLs that have not been revisited after a certain amount of time.
What exactly happens if a browser that supports very long URLs (such as Firefox) submits a long URL to a web server that does not support very long URLs (such as a standard build of Apache)?
The answer: nothing dramatic. Apache responds with a "413 Entity Too Large" error, and the request fails.
This response is preferable to cutting the URL short, because the results of cutting the URL short are unpredictable. What would that mean to the web application? It varies. So it's better for the request to fail.
In the bad old days, some web servers and web browsers failed to truncate or ignore long URLs, resulting in dangerous "buffer overflow" situations. These could be used to insert executable code where it didn't belong... resulting in a security hole that could be exploited to do bad things.
These days, the major browsers and servers are secure against such obvious attacks - although more subtle security flaws are often discovered (and, usually, promptly fixed).
While it's true that modern servers are themselves well-secured against long URLs, there are still badly written CGI programs out there. Those who write CGI programs in C and other low-level languages must take responsibility for paying close attention to potential buffer overflows. TheCGIC library can help with this.
In any case, if you're a web developer and you're still asking this question, then you probably haven't paid attention to my advice about how to avoid the problem completely.