预览模式: 普通 | 列表

中文版正常是:select * from table1 where field1 like '%王%'
英文版要加上N:select * from table1 where field1 like N'%王%'

Tags: asp sqlserver

分类:技术文章 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 3113

在WEB开发中,许多开发者都比较喜欢使用javascript来获取当前url网址,本文就此为大家总结一下比较常用获取URL的javascript实现代码,以下示例是前面为相应实现方法,后面是获取URL的效果,下面以例子讲解:

输入的网址是(没有框架):http://localhost:81/Test/1.htm?Did=123
以下为输出:
 

JavaScript代码
  1. //获取Url传过来的值  
  2. function Request(name)  
  3. {  
  4. new RegExp("(^|&)"+name+"=([^&]*)").exec(window.location.search.substr(1));  
  5. return RegExp.$2  
  6. }  
  7.   
  8. thisURL = document.URL; // http://localhost:81/Test/1.htm?Did=123  
  9. thisHREF = document.location.href; // http://localhost:81/Test/1.htm?Did=123  
  10. thisSLoc = self.location.href; // http://localhost:81/Test/1.htm?Did=123  
  11. thisDLoc = document.location; // http://localhost:81/Test/1.htm?Did=123  
  12.   
  13. thisTLoc = top.location.href; // http://localhost:81/Test/1.htm?Did=123  
  14. thisPLoc = parent.document.location;// http://localhost:81/Test/1.htm?Did=123  
  15. thisTHost = top.location.hostname; // localhost  
  16. thisHost = location.hostname; // localhost  
  17.   
  18. thisU1 = window.location.protocol; // http:  
  19. thisU2 = window.location.host; // localhost:81  
  20. thisU3 = window.location.pathname; // /Test/1.htm  

原文:http://www.cnblogs.com/lechie/archive/2010/08/30/2383228.html

Tags: javascript

分类:技术文章 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 2673

 广告位

↑返回顶部↑