我正在开发一个包含简单 iframe 的网站
<iframe src="" frameborder="0" scrolling="no" id="product" width="100%" height="100%"></iframe>
Run Code Online (Sandbox Code Playgroud)
我在控制台中出现此错误消息: 拒绝在框架中显示 ' http://fr.allsaints.com/women/shop-accessories/allsaints-rally-keyfob/?colour=42&category=700 ' 因为它设置了 'X -“框架选项”为“SAMEORIGIN”。
我该怎么做才能显示它?
这是我的问题.我创建了一个UITextField.
.h文件:
@property (strong, nonatomic) UITextField *emailTextField;
Run Code Online (Sandbox Code Playgroud)
.m文件:
- (void)viewDidLoad
{
[super viewDidLoad];
self.emailTextField.delegate=self;
[self setTextFields:120 :@" email" :self.emailTextField];
}
-(void)setTextFields:(float)ycoord :(NSString *)text :(UITextField *)textField
{
CGRect frame = CGRectMake(60, ycoord, 180, 30);
textField = [[UITextField alloc]initWithFrame:frame];
textField.backgroundColor = [UIColor whiteColor];
textField.placeholder = text;
textField.font = [UIFont fontWithName:@"Baskerville" size:15];
textField.allowsEditingTextAttributes=YES;
textField.autocorrectionType = UITextAutocorrectionTypeNo;
CALayer *lay = [textField layer];
[lay setCornerRadius:5.0f];
[self.view addSubview:textField];
}
Run Code Online (Sandbox Code Playgroud)
目的是保存用户放在TextField中的文本.我尝试了委托方法
-(void)textFieldDidEndEditing:(UITextField *)textField
Run Code Online (Sandbox Code Playgroud)
但是没有调用该方法(我把一个NSLog检查).有人可以帮忙吗?
感谢 PhantomJS,我正在尝试抓取此网页:https : //www.koshkamashkaeshop.com/fr/28-robes-Koshka-Mashka 但每次都无法加载。我认为这是因为https。这是我的 .sh 代码:
phantomjs --ignore-ssl-errors=yes test.js
Run Code Online (Sandbox Code Playgroud)
这是我的 test.js 代码:
page.open(url, function (status) {
var content = page.evaluate(function()
{
if (status !== 'success') {
console.log('FAIL to load the address');
}else{
}
}
)})
Run Code Online (Sandbox Code Playgroud) javascript ×2
delegates ×1
html ×1
iframe ×1
ios ×1
objective-c ×1
phantomjs ×1
ssl ×1
text ×1
uitextfield ×1
web-scraping ×1