小编isN*_*247的帖子

不要调整表格单元格的大小

我在我的一个表(html表元素)单元格中有一个大的URL(没有空格)调整表格大小.我不想调整表的大小,我应该设置什么属性来将URL分解为新行?

HTML

<table class="ui-grid" cellspacing="0" rules="all" border="1" id="MainContent_gvStatistic" style="border-collapse:collapse;">
    <caption>Statistic (Last 50 conversions)</caption>
    <tbody><tr>
        <th scope="col">Date</th>
            <th scope="col">Result</th>
            <th scope="col">Api</th>
            <th scope="col">IP</th>
            <th scope="col">Source</th>
    </tr><tr>
        <td style="width:200px;">12/16/2011 3:23:59 PM</td>
        <td align="center" style="width:50px;">True</td>
        <td align="center" style="width:100px;">Web2Pdf</td>
        <td align="center" style="width:100px;">::1</td>
        <td style="width:200px;">http://a1.quickcatchlabs.com/phototemplates/football_blimp_1.html?i_url=http%3A//lh3.ggpht.com/yf5lVBB_WNBvBHT1HoIzY1SG0-PY5zRCobP3vBacuSk9N346F7CeAIRSFOltR6ZC1-yf-MNKAcAd7bAZ_A%3Ds612-c&amp;i_name=Patriots%20%20vs%20Redskins&amp;i_venue_name=Gillette%20Stadium%20&amp;i_venue_address=Foxborough%20%2C%20MA&amp;d_Score_0=34&amp;d_Score_1=27&amp;d_Period_0=Final&amp;p_name_0=Patriots%20&amp;p_name_1=Redskins</td>
    </tr>   
    </tbody></table>
Run Code Online (Sandbox Code Playgroud)

CSS

.ui-grid { width: 100%; margin: 5px 0 10px 0; border: solid 1px #eeeeee; border-collapse: collapse; }
.ui-grid td { padding: 2px; border: solid 1px #eeeeee; }
.ui-grid td b { font-weight: bold; }
.ui-grid th { padding: …
Run Code Online (Sandbox Code Playgroud)

html css html-table

1
推荐指数
1
解决办法
2万
查看次数

将 DRY 原则应用于此 jQuery 代码

我有这个 jQuery 代码:

var thumb = $($('#slider').children('.ui-slider-handle'));   
setLabelPosition();    

$('#slider').bind('slide', function (event, ui) {   
    $('#boksTimer').html((((ui.value) / 31) * 60).toFixed(0) + ' min pr. dag');
    setLabelPosition();
});


    function setLabelPosition() {
    var label = $('#boksTimer');
    label.css('top', '10px');
    label.css('left', thumb.position().left - (label.width() - thumb.width())/ 2);        
}


var thumb2 = $($('#slider2').children('.ui-slider-handle'));   
setLabelPosition2();    

$('#slider2').bind('slide', function (event, ui) {   
    $('#boksTimer2').html((((ui.value) / 31) * 60).toFixed(0) + ' min pr. dag');
    setLabelPosition2();
});


    function setLabelPosition2() {
    var label2 = $('#boksTimer2');
    label.css('top', '10px');
    label.css('left', thumb2.position().left - (label2.width() - thumb2.width())/ 2); …
Run Code Online (Sandbox Code Playgroud)

javascript jquery

1
推荐指数
1
解决办法
687
查看次数

速率限制 - 单独使用CouchDB与Redis或CouchDB

我用CouchDB后端编写了一个应用程序.我花了很多时间在CouchDB上,所以我不愿意把所有东西都移到不同的NoSQL数据库(比如Redis).

问题是我现在需要实现速率限制(基于IP地址)功能.

很多关于Redis如何用于此类任务的示例,但是因为我不想将CouchDB丢弃用于其他任务,这意味着我基本上将运行(并支持)两个数据库(1个用于大多数数据,1个用于限速)等......

  1. 是否与Redis一起运行CouchDB闻所未闻?
  2. CouchDB本身是否适合处理速率限制本身?

couchdb rate-limiting redis

1
推荐指数
1
解决办法
1316
查看次数

使用JavaScript重新加载一次HTML页面

如何只重新加载一次HTML基本网页?我在body标签中使用history.go(0);函数onLoad,但我只想运行一次.请记住我正在使用,iframe因此无法使用以下类型代码:

<script language=" JavaScript" ><!--
function MyReload()
{
window.location.reload();
}
//--></script>

<Body onLoad=" MyReload()" > 
Run Code Online (Sandbox Code Playgroud)

上面的代码对我不起作用

但下面的代码工作正常,但问题是我需要加载一次

<BODY BGCOLOR=#FFFFFF background="../images/Index_04.jpg" onLoad="history.go(0)" >
Run Code Online (Sandbox Code Playgroud)

注意:我在用户点击主页链接时使用2个iframe,在iframe中加载页面比我想用当前iframe页面重新加载整个页面.

html javascript iframe javascript-events

0
推荐指数
1
解决办法
3万
查看次数

基本的javascript错误

我有以下JavaScript代码:

<script type='text/javascipt' language="javascript">
    function getUserLoc() {
        if (navigator.geolocation) {
            navigator.geolocation.getCurrentPosition(displayResult, displayError);
        }
        else {
            setMessage("Geolocation is not supported by this browser");
        }
    }
    function displayResult(position) {
        setMessage("Latitude: " + position.coords.latitude + ", Longitude: " + position.coords.longitude);
    }
    function setMessage(msg) {
        document.forms[0].myLoc.value = msg;
    }
    function displayError(error) {
        var errors = { 1: 'Permission denied', 2: 'Position unavailable', 3: 'Request timeout' };
        setMessage("Error occured: " + errors[error.code]);
    } 
</script>
Run Code Online (Sandbox Code Playgroud)

和ASP.NET一样:

<asp:Button ID="LoginButton" runat="server" Text="Log In" ValidationGroup="LoginUserValidationGroup"
            OnClientClick="getUserLoc( )"  />
Run Code Online (Sandbox Code Playgroud)

但是,当我单击"LoginButton"时,我收到JavaScript错误: …

javascript c# asp.net

-3
推荐指数
1
解决办法
130
查看次数