函数:get_page_link(页面id编号) 作用:获取指定页面的链接地址 用法: $link = get_page_link(2); 输出为:xxx/?page_id=2 如在循环里则不用填写id参数,否则必须指定.…
获取页面地址url的指定部分信息,总结在一个方法体中: /** * 获取项目跟路径,http://localhost:8080/myproject *@returns */ var getCurUrlInfo = function () { //获取当前网址,如: http://localhost:8088/myproject/index/login.html var curWwwUrl=window.document.location.href; //获取主机地址之后的目次,如: myproj…
window.location对象的属性: 属性 含义 值 location.protocol 协议 "http://"或"https://" location.hostname 服务器名字 "baidu.com" location.port 端口 "8080" location.pathname URL中主机名后的部分 "/index.php" location.search "?"后…
var url = window.location.href; //获取当前窗口的Url; 结果:http://localhost:61768/Home/Index?id=2&age=18 var host = window.location.host;//获取当前窗口的主机名; 结果:localhost:61768 var port = window.location.port; //获取当前窗口的端口; 结果:61768 var pathname = window.location.path…
<script language="javascript"> //获取域名 hostName = window.location.host; host2=document.domain; //获取页面完整地址 url = window.location.href; if(hostName=='www.utailor.com.cn'){ document.write('<ul id="loginBar_<{$widgets_id}>" s…
PHP $_SERVER['PHP_SELF'] $_SERVER['PHP_SELF'] 表示当前 php 文件相对于网站根目录的位置地址,与 document root 相关. 假设我们有如下网址,$_SERVER['PHP_SELF']得到的结果分别为: http://www.5idev.com/php/ :/php/index.php http://www.5idev.com/php/index.php :/php/index.php http://www.5idev.com/php/i…
DOM入门 DOM就是Html页面的模型,将每个标签都做为一个对象,JavaScript通过调用DOM中的属性.方法就可以对网页中的文本框.层等元素进行编程控制.比如通过操作文本框的DOM对象,就可以读取文本框中的值.设置文本框中的值. JavaScript→DOM就是C#→.Net Framwork.没有.net,C#只能for.while,连WriteLine.MessageBox都不行.DOM就是一些让JavaScript能操作Html页面控件的类.函数. DOM也像WinForm一样,通…
给网页中的所有<p>元素添加onclick事件 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <…
函数:wp_list_pages($args) 作用:列出某个分类下的分类项目 常见参数说明: 参数 用途  值   sort_column  排序方式 post_title 按标题排序 [默认] menu_order 按照页面的数序排序(在发布页面时设置的“排序”属性的值) post_date 按照页面的发布时间排序 post_modified 按照页面的修改时间排序 ID 按照页面的编号排序 post_author 按照页面的作者的编号排序 post_name 按照页面的别名排序  sort…
#测试网址:     http://localhost/blog/testurl.php?id=5   //获取域名或主机地址 echo $_SERVER['HTTP_HOST']."<br>"; #localhost   //获取网页地址 echo $_SERVER['PHP_SELF']."<br>"; #/blog/testurl.php   //获取网址参数 echo $_SERVER["QUERY_STRING"…