Eric @ EricBess WebHome

Wins do not arrogant, not to lose hungry, there is shock chest and face, such as mine Pinghu

Chinese (Simplified) flagItalian flagKorean flagPortuguese flagEnglish flagGerman flagFrench flagSpanish flagJapanese flagArabic flagRussian flagGreek flagDutch flagBulgarian flagCzech flagCroat flagDanish flagFinnish flagHindi flagPolish flagRumanian flagSwedish flagNorwegian flag
By N2H

JQuery selector proficient in the use of [to]

jQuery has a very powerful engine selector, to provide a complete selector syntax, we have chosen to allow almost all elements of the portfolio. jQuery selector of the syntax and CSS3 is mainly based on the XPath, and CSS3 understand XPath more use of the more significant when jQuery handy. CSS and related XPath, see the following links:

It is worth noting that, CSS3 does not get all the current browser support, so we rarely use it. However, we can still use jQuery choice CSS3 elements, as jQuery have their own custom selector engine, and the realization of the CSS3 support.

JQuery selector would like to know more information, visit the official jQuery documentation relating to Selector. Now, the original official documents on the basis of a few simple translation and notes.

1. CSS selector (CSS Selectors)

jQuery full support for CSS 1-3, and it can be (selector) expression, adding custom CSS-like (and xPath).

Click to continue reading

July 21st, 2008 Posted by eric | Coding | no comments

Jquery effect: "click-to-change"

Target

Using an AJAX (or AHAH) technology designed page, without leaving the visitors will be able to see in the (x) HTML page editorial content.

Program

Click on the need to edit the text, changing with a cancel button and save the textarea. To amend the part of the AHAH will be sent to a server-side PHP script file to update the database (MySQL or ordinary paper).

Demonstration

AJAX-style click-to-change demonstration
In this first demonstration, I used an id for "editinplace" the div element. When the mouse across here, the background color will be light yellow. Click on the text of some of the DOM will start operation, div elements have been replaced by a textarea elements - contained within the original text.
Click the Save button to the server-side PHP scripts to send a new HTML document, and re-exports received a new text (by $ _POST).
In real-world environments, you should also add a safety testing before they are able to update the database and return the updated page content, colleagues informed the successful implementation of jQuery.

1 2 3

July 20th, 2008 Posted by eric | Coding, Web technology | no comments

Jquery results: stylesheet switch

DEMO

The familiar opening
$ (document). ready (function () (
$ ( '. styleswitch'). click (function ()

Tell jQuery "as fast as possible to find the object that contains all of 'styleswitch' elements, and they were in when a mouse click functions."
Looks good. When the mouse clicks in advance of the specified element, switchStylestyle function will be called. From now on, the focus is.

$ ( 'link [@ rel *= style]'). each (function (i) (

What these words mean?
JQuery to find the author of John Resig, to his advice. He gave me a direct jQuery website address of the page, on which a number of jQuery advanced features (xpath), can be used to find and operate a number of elements of the page. If you read these things you will be able to understand the mysterious code phrase above, the meaning is to tell jQuery "to find with all the rel attribute values and attributes included in the string 'style' link elements of the link."

Click to continue reading

July 20th, 2008 Posted by eric | Coding, Web Technology | one comment

PHP FixPath Function [path finishing function]

FixPath Function: fix the dirty paths. PHP path sorting function.
Example:

? View Code PHP
 1 
 2 
 3 
 4 
 5 
 6 
 7 
 8 
 9 
 10 
 11 
 12 
 13 
 14 
 15 
 16 
 17 
 18 
  <? Php 
      Dirty paths: \n " ; echo "\ n \ n \ n Dirty paths: \ n"; 
  = 'C://////////Windows//////System' ; //  C:/System $ paths [] = 'C :////////// Windows ////// System'; / / C: / System 
  = 'C:\HTML\javascript\..\examples\colors.html' ; //  C:/HTML/examples/colors.html $ paths [] = 'C: \ HTML \ javascript \ .. \ examples \ colors.html'; / / C: / HTML / examples / colors.html 
  = '/root/./wwwroot/scripts/../././webpage' ; //  /root/wwwroot/webpage $ paths [] = '/ root /. / wwwroot / scripts / .. /. /. / webpage'; / / / root / wwwroot / webpage 
  = 'wwwroot/webpage/../index.php?querystring' ; //  wwwroot/index.php?querystring $ paths [] = 'wwwroot / webpage / .. / index.php? querystring'; / / wwwroot / index.php? querystring 
  = 'http://www.php.net/manual/en/../../downloads' ; //  http://www.php.net/downloads $ paths [] = 'http://www.php.net/manual/en/../../downloads'; / / http://www.php.net/downloads 
  = 'http://www.php.net/downloads/test/test1/test2//./docs.php' ; //  http://www.php.net/docs.php $ paths [] = 'http://www.php.net/downloads/test/test1/test2//./docs.php'; / / http://www.php.net/docs.php 
  = '../downloads/../docs.php' ; //  ../docs.php $ paths [] = '.. / downloads / .. / docs.php'; / / .. / docs.php 
  = 'localhost//projetos/../_arquivos/../' ; //   "" $ paths [] = 'localhost / / projetos / .. / _arquivos /../'; / / "" 
  = 'C:/downloads/../../../' ; //  C:/ $ paths [] = 'C: / downloads /../../../'; / / C: / 
  = 'downloads/../../../' ; //  ../../ $ paths [] = 'downloads /../../../'; / / ../../ 

  $paths as $path ) foreach ($ paths as $ path) 
  ( 
      &quot;" . $path . "&quot;  =  &quot;" .  fixpath ( $path ) . "&quot;" ; echo "\ n" ". $ path." "=" ". fixpath ($ path)." ""; 
  ) 
  ?> 
Note: "/ /" one more slashes will roll back the root.

Click to continue reading

July 17th, 2008 Posted by eric | unclassified | no comments

FindRelativePath Function [path to find out the relationship between the relative]

PHP FUNCTION: Found the relative between the path.
PHP function: to find the path between the relative relationship.

Example:

? View Code PHP
 1 
 2 
 3 
 4 
 5 
 6 
 7 
 8 
 9 
  <? Php 
  'http://www.php.net/manual/en/install.php' ; $ path_a = 'http://www.php.net/manual/en/install.php'; 
  'http://www.php.net/downloads' ; $ path_b = 'http://www.php.net/downloads'; 

  Path A:  " . $path_a ; echo "\ n Path A:". $ path_a; 
  Path B:  " . $path_b ; echo "\ n Path B:". $ path_b; 
  A to B:  " .  findRelativePath ( $path_a , $path_b ) ; //  ../../downloads/ echo "\ n A to B:". findRelativePath ($ path_a, $ path_b); / / .. / .. / downloads / 
  B to A:  " .  findRelativePath ( $path_b , $path_a ) ; //  ../manual/en/install.php echo "\ n B to A:". findRelativePath ($ path_b, $ path_a); / / .. / manual / en / install.php 
  ?> 

Function:

Click to continue reading

July 17th, 2008 Posted by eric | Coding | 2 comments

[To] in layman's language of regular expressions

Preface:

Six months ago I have had regular expressions of interest in on-line to find a lot of information, read a lot of course, the last in the use of a regular expression tool RegexBuddy when he found the course very well written, it can be said that I have seen the best regular expression tutorial. As a result he would like to have been translated. The aspirations of the long holiday until May 1 this can be achieved, the results will have this article. This article on the name, "in layman's language" seems to have Taisu. But read the original text, only that "in layman's language" in order to correct the course to express my feelings, it can not escape the.

Jan Goyvaerts for this article was written by RegexBuddy course of the translation, the original author copyright of all, welcome to reprint. However, in order to respect the original author and translator of the work, please reference! Thanks!

What is a regular expression

Basically said, is a regular expression used to describe a certain number of text mode. Regex on behalf of the Regular Express. This article will be <<regex>> to indicate the specific section of the regular expression. A section of text is the most basic model, a simple match the same text.

Different regular expression engine

Regular expression engine is a regular expression processing software. Typically, the engine is a bigger part of the application. In the software world, different regular expressions are not compatible with each other. The present course will focus on the Perl 5 types of engines, engine because it is the most widely used engines. At the same time, we will also talk about some of the engine and other differences. Many modern engines are very similar, but not exactly the same. For example. NET regular library, JDK regular package.

Sign language

The most basic regular expression from a single text symbols. If <<a>>, it will match the first time in the string of characters "a". If the string of "Jack is a boy". "J" after "a" will be matched. And the second "a" will not be matched. Regular expressions can match the second "a", which tells you must be a regular expression engine from the first match of the beginning of local search. In a text editor, you can use the "Find Next." In the programming language, there will be a function can be used to make your first match back to the beginning of the location of the search.

A similar, <<cat>> will match "About cats and dogs" in the "cat". This is tantamount to tell regular expression engine to find a <<c>>, keep up with a <<a>>, a point with <<t>>.

Bearing in mind that regular expression engine is the default case-sensitive. Unless you tell the engine Ignore case, or else <<cat>> will not match the "Cat".

Special characters

The text characters, 11 characters were retained for special purposes. They are: [] \ ^ $. |? * ()

These special characters are also known as the yuan characters.

If you would like regular expressions of these characters will be used for text characters, you need to use the backslash, "\" for their code (escape). For example, you want to match "1 1 = 2", the right to expression <<1 \ 1 = 2>>.

It should be noted that, "<1 1 = 2>> is a valid regular expression. However, it does not match the "1 1 = 2" and the match will be "123 111 = 234" "111 = 2." " ", Said a special meaning here (1st to repeat many times).

In the programming language, bearing in mind that some special characters will be dealing with the compiler, and then to the longer regular engine. Therefore, regular expressions <<1 \ 2 = 2>> in C to write in "1 \ \ 1 = 2." In order to match the "C: \ temp", you should use regular expressions <<C:\\temp>>. In the C , the regular expression has been turned into "C: \ \ \ \ temp".

Click to continue reading

July 15th, 2008 Posted by eric | Coding | no comments

2 » Page 1 of 2 1 2 »