* Escape text for attribute or text content.
( s )
| 975 | * Escape text for attribute or text content. |
| 976 | */ |
| 977 | function escapeText( s ) { |
| 978 | if ( !s ) { |
| 979 | return ""; |
| 980 | } |
| 981 | s = s + ""; |
| 982 | // Both single quotes and double quotes (for attributes) |
| 983 | return s.replace( /['"<>&]/g, function( s ) { |
| 984 | switch( s ) { |
| 985 | case "'": |
| 986 | return "'"; |
| 987 | case "\"": |
| 988 | return """; |
| 989 | case "<": |
| 990 | return "<"; |
| 991 | case ">": |
| 992 | return ">"; |
| 993 | case "&": |
| 994 | return "&"; |
| 995 | } |
| 996 | }); |
| 997 | } |
| 998 | |
| 999 | function synchronize( callback, last ) { |
| 1000 | config.queue.push( callback ); |