21视频教程网3月28日整理
package {
import flash.display.Sprite;
public class decodeURIExample extends Sprite {
public function decodeURIExample() {
var uri:String = "http://www.example.com/application.jsp?user=%3Cuser%20name='some%20user'%3E%3C/user%3E";
var decoded:String=decoded(uri);
trace(decoded); // http://www.example.com/application.jsp?user=<user name='some user'></user>
}
}
}
}
???
package {
import flash.display.Sprite;
public class encodeURIExample extends Sprite {
public function encodeURIExample() {
var uri:String = "http://www.example.com/application.jsp?user=<user name='some user'></user>";
var encode:String=encodeURI(uri);
trace(encode); // http://www.example.com/application.jsp?user=%3Cuser%20name='some%20user'%3E%3C/user%3E
}
}
}
}
???
//下面的代码生成结果 someuser%40somedomain%2Ecom:
var email:String = "someuser@somedomain.com";
trace(escape(email));
var redirectUrl:String = "http://www.somedomain.com?loggedin=true&username=Gus";
sendToURL("http://www.myothersite.com?returnurl="+ escape(redirectUrl));
var email:String = "user@somedomain.com";
trace(email);
var escapedEmail:String = escape(email);
trace(escapedEmail);
var unescapedEmail:String = unescape(escapedEmail);
trace(unescapedEmail);
Flash教程
Word教程网 | Excel教程网 | Dreamweaver教程网 | Fireworks教程网 | PPT教程网 | FLASH教程网 | PS教程网 |
HTML教程网 | DIV CSS教程网 | FLASH AS教程网 | ACCESS教程网 | SQL SERVER教程网 | C语言教程网 | JAVASCRIPT教程网 |
ASP教程网 | ASP.NET教程网 | CorelDraw教程网 |