您正在查看 "Js" 分类下的文章
2008年06月19日 星期四 08:42
FCKeditorAPI中文用例说明
function abc()
{ var checkContent =FCKeditorAPI.GetInstance("editor");//获取实例
alert(checkContent.GetXHTML());//获取当前内容
var newelement = document.createElement("a");
newelement.href="#";
newelement.innerHTML="df";
checkContent.InsertElement(newelement);//前部添加元素(无返回值)
var a=checkContent.InsertElementAndGetIt(newelement);//前部添加元素(返回元素) checkContent.InsertHtm |
2008年06月19日 星期四 08:20
<body>
</body>
</html>
<script>
descript="第一段script"
</script>
<script>
descript="第二段script"
str=document.body.innerHTML
a=str.match(/\<script((.|\n)*?)\<\/script\>/gi)
alert(a[0])
alert(a[1])
</script>
|
2008年06月19日 星期四 08:01
<script>
window.onload=function()
{
var img=opener.document.body.innerHTML.replace(/images\//g,"http://bbs.51js.com/$&").match(/http:\/\/.+?\.gif/g);
document.body.innerHTML=img.join("<br>");
document.charset="_autodetect_all";
}
</script>
<script>
window.onload=function()
{
img=[];
for(i=0;i<opene |
2008年06月19日 星期四 07:58
<script language="javascript" type="text/javascript">
<!--///
$(function(){
//alert("?");
$("#chkimg").click(function(){
if(this.checked)
{
$("#sp | |
2008年06月18日 星期三 14:38
关于Html传递参数的问题的一些参考代码:
1.
我们知道,在服务器端asp程序可以接受html页面上的form传来的参数。
那么,可不可以传递参数给html页面呢。可以。
下面是javascript的一种实现方法, 这个函数是通过window.location.href中的分割符获得各个参数。
有了这个函数,就可以在页面之间传递参数了。
/*
*函数功能:从href获得参数
*sArgName:arg1, arg2
*return: the value of arg. d, re
*/
function GetArgsFromHref(sHref, sArgName)
{ |
2008年06月18日 星期三 14:32
最好借用 Div 或 Span 的 innerText 来过滤. 这样可以过滤javascript 不受事件属性中的小于号,大于号干扰 document.getElementById('tempDiv').innerHTML = "这里写各种HTML代码"; alert( document.getElementById('tempDiv').innerText);
<script>
str = "<a href=\"xxx.asp\"><div>1234567</div>89</a>";
alert(str.replace(/<.*?>/g,""));
</script>
<script language="JavaScript" type=" |
2008年03月09日 星期日 15:24
2008年02月16日 星期六 11:23
页面自动刷新代码大全,基本上所有要求自动刷新页面的代码都有,大家可以自由发挥做出完美的页面。
1)
10表示间隔10秒刷新一次
2)
<script>
window.location.reload(true);
</script>
如果是你要刷新某一个iframe就把window给换成frame的名字或ID号
3)
<script>
window.navigate("本页面url");
</script>
4>
function abc()
{
window.location.href="/blog/window.location.href";
setTimeout("a |
2008年01月31日 星期四 11:54
WINDOW.CLOSE在IE下默认为关闭当前页,在FIREFOX里默认为,不显示当前页,所以你的代码不兼容了.而却你(1)的代码,是关一个打开一个,其实不是在同一个网页里进行的也会给使用带来不便.
(2)代码LOCATION =""和LOCATION.HREF=""是一样的.
不过IE和FIREFOX对LOCATION这个指令都认,所以我给你下了以下代码.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
" http://www.w3.org/TR/xhtml1 |
2008年01月28日 星期一 20:02
一.直接引用结点
1.document.getElementById(id);
--在文档里面通过id来找结点
2.document.getElementByTagName(tagName);
--返回一个数组,包含对这些结点的引用
--如:document.getElementByTagName("span");将返回所有类型为span的结点
二.间接引用结点
3.element.childNodes
|
|
|