如何在HTML iFrame中检测滚动条的存在(使用Javascript)?
我已经尝试过了:
var vHeight = 0;
if (document.all) {
if (document.documentElement) {
vHeight = document.documentElement.clientHeight;
} else {
vHeight = document.body.clientHeight
}
} else {
vHeight = window.innerHeight;
}
if (document.body.offsetHeight > vHeight) {
//when theres a scrollbar
}else{
//when theres not a scrollbar
}
Run Code Online (Sandbox Code Playgroud)
我也尝试过:
this.scrollLeft=1;
if (this.scrollLeft>0) {
//when theres a scrollbar
this.scrollLeft=0;
}else{
//when theres not a scrollbar
return false;
}
Run Code Online (Sandbox Code Playgroud)
没有成功..
我在DOM Inspector上搜索了javascript objets,但没有找到任何内容.
是否可以在javacscript中检测iframe中的滚动条存在?
iframe内容来自同一个域.
直到现在都没有成功..
我想要的是:
这只能用CSS和HTML(没有任何javascript)吗?
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8"/>
<title>Test</title>
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"/>
<style>
*{
margin:0px;
padding:0px;
}
header, nav, article, footer, address {
display: block;
}
header{
position:relative; height: 50px; background-color:#2b2b2b;
}
footer{
height: 50px;
width:100%;
bottom: 0px;
position: fixed;
background: red;
}
#explorer{
position:relative; bottom:55px;
}
#sections{
width: 100%; height: 100%; bottom: 55px; position:fixed; background: blue;
}
</style>
</head>
<body style="background-color:yellow">
<header >
<h1>Test</h1>
</header>
<div id="explorer" >
<div id="sections" > …Run Code Online (Sandbox Code Playgroud) 我无法在XAMPP 1.7.3上隐藏Codeigniter index.php
网址:
http://localhost/Servidor/agentesRainbow/index.php/agentes/tony
Run Code Online (Sandbox Code Playgroud)
托尼是一个论点
我的实际.htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /Servidor/agentesRainbow/
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /Servidor/agentesRainbow/index.php/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#This last condition enables access to the images and css folders, and …Run Code Online (Sandbox Code Playgroud) 我遵循了基本的安装(http://railscasts.com/episodes/67-restful-authentication)
这样做:
1.)ruby脚本/生成经过身份验证的用户会话
2.)ruby脚本/生成经过身份验证的用户会话和 rake db:migrate
3.)在我包含的文件application_controler.rb上
include AuthenticatedSystem
Run Code Online (Sandbox Code Playgroud)
4.)在我包含的文件routes.rb上
map.signup '/signup', :controller => 'users', :action => 'new'
map.login '/login', :controller => 'session', :action => 'new'
map.logout '/logout', :controller => 'session', :action => 'destroy'
map.activate '/activate/:activation_code', :controller => 'users', :action => 'activate', :activation_code => nil
Run Code Online (Sandbox Code Playgroud)
问题是在localhost:3000 /看起来和通常一样 "欢迎你乘坐Ruby on Rails!"页面.
如何将登录页面显示在localhost:3000上?
例如,如果我在表单中选择[URL值],将[URL值]保存在数据库中,然后在如下页面中使用它:
<a href="[URL value]" > The Link </a>
Run Code Online (Sandbox Code Playgroud)
如何防止此[URL值]:
http://www.somelink.com"> Evil text or can be empty </a> ALL THE EVIL HTML I WANT <a href="
Run Code Online (Sandbox Code Playgroud)
如何保护URL表单文件的这种HTML注入,而不会破坏URL,以防它有效?