小编nim*_*rod的帖子

iOS:强制UIWebView重新加载/阻止缓存

我有一个显示网站的iPhone应用程序.这个网站不时更改它的内容,但我的应用程序不会在每次打开时重新加载它.我试图阻止网站的缓存,但没有成功.

这是我的init方法:

- (id)init:(NSString *)url withTitle:(NSString *)theTitle withPageName:(NSString *)pageName {
    self = [super init];
    if(self) {
        NSLog(@"websiteviewcontroller init");
        self.title = theTitle;
        self.url = url;
        self.pageName = pageName;

        CGRect frame = [[UIScreen mainScreen] applicationFrame];
        webView = [[UIWebView alloc] initWithFrame:frame];

        NSURL *theURL = [NSURL URLWithString:url];
        [webView loadRequest:[NSURLRequest requestWithURL:theURL]]; 

        // support zooming
        webView.scalesPageToFit = YES;

                //[[NSURLCache sharedURLCache] removeAllCachedResponses];
                [webView reload];

    }
    return self;
}
Run Code Online (Sandbox Code Playgroud)

这是我的viewWillAppear-Method:

- (void)viewWillAppear:(BOOL)animated {

    CGRect frame = [[UIScreen mainScreen] applicationFrame];
    webView = [[UIWebView alloc] initWithFrame:frame];

    NSURL *theURL = [NSURL …
Run Code Online (Sandbox Code Playgroud)

objective-c uiwebview ios5

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

GenericJDBCException:列类型无效:getCLOB未实现

我正在尝试从JBoss 5.1迁移到JBoss 7.1.1,目前有这个问题.每当我尝试从包含CLOB字段的数据库中获取对象时,都会抛出此错误:

11:48:58,974 INFO  [org.hibernate.event.internal.DefaultLoadEventListener] (http-localhost-127.0.0.1-8080-1) HHH000327: Error performing load command : org.hibernate.exception.GenericJDBCException: Invalid column type: getCLOB not implemented for class oracle.jdbc.driver.T4CVarcharAccessor
11:48:58,984 ERROR [org.jboss.ejb3.invocation] (http-localhost-127.0.0.1-8080-1) JBAS014134: EJB Invocation failed on component PackageHandling for method public PackageManagement.PackageHandling$FilteredPackageList PackageManagement.PackageHandling.getFilterPackages(java.lang.String,java.lang.String,java.lang.Integer,java.lang.String,java.lang.Integer,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.Integer,int,int,java.lang.String,java.lang.String): javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Invalid column type: getCLOB not implemented for class oracle.jdbc.driver.T4CVarcharAccessor
    at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:166) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:230) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:304) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
    at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
    at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
    at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) …
Run Code Online (Sandbox Code Playgroud)

java jdbc oracle11g

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

从iCloud获取CalDAV事件将返回"403 Forbidden"

我正在使用SimpleCalDAV客户端使用PHP从iCloud(Apple)获取日历事件.在Apple引入特定于应用程序的密码之前,这个客户端运行良好 从那时起,对于某些用户帐户,我总是得到"403 Forbidden"结果:

连接到iCloud服务器:

请求标题:

OPTIONS / HTTP/1.1
Host: p30-caldav.icloud.com
Authorization: Basic bWFxxxxmZlbGRlckBxxxxxbmNlcHQuY2xxxxxxxxxtY3pyeC15YWZxxxxxxxx3b3o=
User-Agent: cURL based CalDAV client
Accept: */*
Content-type: text/plain
Run Code Online (Sandbox Code Playgroud)

请求机构

HTTP/1.1 200 OK
Server: AppleHttpServer/2f080fc0
Date: Sun, 21 Jan 2018 15:29:33 GMT
Content-Type: text/plain; charset=UTF-8
Content-Length: 0
Connection: keep-alive
X-Apple-Jingle-Correlation-Key: 3IAOX5DL3ZA5NGIXT57LTVFH3Q
apple-seq: 0
apple-tk: false
Apple-Originating-System: UnknownOriginatingSystem
X-Responding-Instance: caldavj:15701001:st41p57ic-qufb10212001:8501:17H89:22adb24b
Allow: ACL, COPY, DELETE, GET, HEAD, LOCK, MKCOL, MOVE, OPTIONS, PROPFIND, PROPPATCH, PUT, REPORT, UNLOCK
DAV: 1, access-control, calendar-access, calendar-schedule, calendar-auto-schedule, calendar-managed-attachments, calendarserver-sharing, calendarserver-subscribed, calendarserver-home-sync, calendar-audit, …
Run Code Online (Sandbox Code Playgroud)

php curl calendar caldav icloud

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

使用jQuery获取父<li>项

<li>当我点击特定<li>项目时,我正在尝试获取父项.

http://jsfiddle.net/doonot/GjbZk/

所以,让我说我点击submodule 1,我得到点击的ID $(this).attr('id'); 我现在如何获得父母的ID,<li>在这种情况下module 1

请注意我的树很大,所以它必须灵活.

非常感谢,非常感谢您的回答.

javascript treeview jquery html5 jquery-selectors

6
推荐指数
3
解决办法
4万
查看次数

在pickadate-picker中禁用日期并刷新它

我在初始化日期选择器后尝试禁用某些日期.

我正在初始化这样的选择器:

$( document ).ready(function() {
    $('#inputDatetime').pickadate({
        format: 'dd. mmmm yyyy',
        formatSubmit: 'yyyy-mm-dd',
        min: dt,
        selectYears: 2,
        selectMonths: true
    });
});
Run Code Online (Sandbox Code Playgroud)

用户现在执行一些触发onChange()事件的操作.该disableDates()函数准备了更多日期以禁用并使用以下set方法将其设置为选择器:

function disableDates() {

    var disabledDays = [];

    $.ajax({  
        url: 'partners/getInactiveDays',
        dataType: 'json',
        async: false,
        success: function(data) {

            $.each(data.days, function(i, d) {
                disabledDays.push(parseInt(d.Day.id));
            });
        }
    });

    var $input = $('#inputDatetime').pickadate();
    var picker = $input.pickadate('picker');

    picker.set({
        disable: disabledDays
    });
}
Run Code Online (Sandbox Code Playgroud)

请注意,根据文档(http://amsul.ca/pickadate.js/date/#disable-dates),在我的情况下,disableDays包含整数(平日的工作日)和日期.

disableDates()第一次触发该函数时,它会正确地禁用我使用AJAX检索的日期.一旦第二次触发,选择器似乎不再更新.我想必须以某种方式再次渲染选择器来反映变化.我试过了 .stop().start().render() …

javascript jquery pickadate

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

如何使用formvalidation.io和jQuery验证单选按钮?

我正在使用来自amazingSurgejquery-wizard插件以及formvalidation.io插件.我的目的是在用户想要在向导中前进后进行表单验证.这对于正常输入验证和复选框验证非常有用.但是,我在验证无线电输入表格时遇到了问题.当我选择第一个单选按钮时,表单只允许我前进.当我在表单中有20个单选按钮并选择第三个时,表单验证说我没有选择任何东西!

这是我的验证码:

$('#employeeForm').formValidation({
    framework: 'bootstrap',
    fields: {
        employeeInput: {
            validators: {
                notEmpty: {
                    message: 'Please choose an employee'
                }
            }
        }
    }
});

wizard = $("#exampleWizardForm").wizard(options).data("wizard");

wizard.get("#employees").setValidator(function() {
    var fv = $("#employeeForm").data("formValidation");
    return fv.validate(), fv.isValid() ? !0 : !1
});

// add validation after form was dynamically created
$('#employeeForm').formValidation('addField', $("#employeeInput"));
Run Code Online (Sandbox Code Playgroud)

这是我的表格:

<form id="employeeForm" novalidate="novalidate" class="fv-form fv-form-bootstrap">
<div class="table-responsive">
    <table class="table table-hover text-right">
        <tbody id="employee_items">
            <tr>
                <td class="text-center">
                    <label><input type="radio" value="196" name="employeeInput" id="employeeInput" kl_vkbd_parsed="true"></label>
                </td> …
Run Code Online (Sandbox Code Playgroud)

html javascript forms jquery formvalidation.io

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

使用CakePHP 3.2上的cakephp-upload插件,图像不会保存到photo_dir文件夹中

我正在使用cakephp-upload插件,我设法将图像上传到我的服务器:

WorkersTable:

public function initialize(array $config)
{
    parent::initialize($config);

    $this->table('workers');
    $this->displayField('id');
    $this->primaryKey('id');

    $this->addBehavior('Josegonzalez/Upload.Upload', [
        'avatar' => [
            'fields' => [
                'dir' => 'photo_dir'
            ]
        ]
    ]);
}
Run Code Online (Sandbox Code Playgroud)

view.ctp:

echo $this->Form->create($newWorker, ['type' => 'file']);
echo $this->Form->input('avatar', ['type' => 'file']);
echo $this->Form->input('photo_dir', ['type' => 'hidden']);
Run Code Online (Sandbox Code Playgroud)

现在上传了头像图像,但它们没有放入photo_dir子目录中.

在此输入图像描述

我错过了什么?它在我的CakePHP 2.8.x应用程序中没有任何问题.

php cakephp image-uploading cakephp-3.0

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

集成的Web组件在Angular 6中使用了错误的base-href

我刚刚使用Angular 6创建了我的第一个Web组件.一切正常,直到我尝试将Web组件集成到现有应用程序中:

集成了Web组件的应用程序(https://www.example.com):

<script type="text/javascript" src="https://component.example.com/html-imports.min.js"></script>
<link rel="import" href="https://component.example.com/element.html">
<my-web-component uuid="2342-asdf-2342-ffsk"></my-web-component>
Run Code Online (Sandbox Code Playgroud)

我的Web组件index.html不包含base-href.

浏览器现在尝试加载Web组件的资源:

https://www.example.com/assets/i18n/de_CH.json
Run Code Online (Sandbox Code Playgroud)

代替

 https://component.example.com/assets/i18n/de_CH.json
Run Code Online (Sandbox Code Playgroud)

当我尝试在构建期间添加base-href时,会导致:

ng build --configuration=development --base-href https://component.example.com/

Cannot read property 'startTag' of null          
TypeError: Cannot read property 'startTag' of null
    at IndexHtmlWebpackPlugin.<anonymous> (/home/www-data/.../node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/index-html-webpack-plugin.js:147:62)
    at Generator.next (<anonymous>)
    at fulfilled (/home/www-data/.../node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/index-html-webpack-plugin.js:4:58)
Run Code Online (Sandbox Code Playgroud)

任何帮助都非常感谢,我的想法已经不多了.

web-component angular-cli angular angular6 angular-elements

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

在网站加载时显示旋转轮或进度条

我正在使用一个名为jquery-treeview的jQuery插件构建一个树视图.构建此树视图需要花费大量时间(约5-7秒),并且我希望在页面加载时显示旋转轮或进度条.有谁知道这是怎么做到的吗?我只找到了加载视频或图像的解决方案,其中已知有多少数据需要加载.

javascript jquery html5

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

使用PHP检测日历事件重叠冲突

我正在开发一项功能,用于检查外部事件是否与内部事件(在日历应用程序中)发生冲突。该过程如下所示:

  • 我的应用程序创建了一系列可能的事件(称为$internalEvents
  • 我从 Google 日历、iCloud 等日历中获取外部事件(称为$externalEvents)。这些是类型为 的现有事件busy
  • 现在我必须检查内部和外部事件是否存在任何冲突。我尝试了一些你可以在下面看到的东西,但这远远不正确或防弹。

我试图尽可能地将其减少到最低限度。这是数据输入:

$internalEvents = array(
    array(
        "start" => "03/29/2016 12:00:00",
        "end" => "03/29/2016 13:00:00"
    ),
    array(
        "start" => "03/29/2016 12:30:00",
        "end" => "03/29/2016 13:30:00"
    ),
    array(
        "start" => "03/29/2016 13:00:00",
        "end" => "03/29/2016 14:00:00"
    ),
    array(
        "start" => "03/29/2016 13:30:00",
        "end" => "03/29/2016 14:50:00"
    ),
    array(
        "start" => "03/29/2016 14:00:00",
        "end" => "03/29/2016 15:00:00"
    ),
    array(
        "start" => "03/29/2016 14:30:00",
        "end" => "03/29/2016 15:30:00"
    ),
    array(
        "start" …
Run Code Online (Sandbox Code Playgroud)

php datetime

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