我正在使用jQuery cookie插件(也尝试过EZCookie),我在firefox中遇到了这个错误:
'$.cookie is not a function'
at line:
if(!( $.cookie('name') == null) ) {
Run Code Online (Sandbox Code Playgroud)
我在IE 6中遇到了不同的javascript错误
"Object doesn't support this property or method"
Run Code Online (Sandbox Code Playgroud)
奇怪的是我评论时$(document).ready(function() {,
我没有收到任何错误,但是我也没有看到cookie(即使在从另一个应用程序设置cookie之后).
任何人都有一个线索在这里发生....
这是我使用的代码:
<script type="text/javascript">
var var2= "";
$(document).ready(function() {
if($.cookie('name').length > 0) {
alert("cookie present"+$.cookie('name'));
<%
String[] var1= (String[]) componentRequest.getComponentSession().getValue("var");
if(!(null == offices)){
for(int i = 0; i < var1.length; i++){%>
var2+=<%=var1[i]%>+",";
<%}
}%>
$('#tempCookieVal').val(var2+$.cookie('name'));
$('#cookieForm').submit();
}else{
alert("no cookie");
$('#tempCookieVal').val("NoCookie");
$('#cookieForm').submit();
}
alert("cookie check done");
});
</script>
<form id="cookieForm" >
<input …Run Code Online (Sandbox Code Playgroud) 我正在使用facebook iOS SDK安装教程:https://developers.facebook.com/docs/mobile/ios/build/
在第4步:添加注销到您的应用程序后,
我在5.1模拟器(xcode 4.3.2)上看到一个空白的白色屏幕,控制台显示一条消息:
应用程序窗口应在应用程序启动结束时具有根视图控制器
编辑-1
谢谢你的回复; 我在创建应用程序时选择了"单一视图应用程序"模板.在MainStoryBoard.storyboard中,我创建了一个对象并为其分配了MyGreatIOSAppAppDelegate类.将此对象的viewController出口拖放到View Controller.
这是MyGreatIOSAppAppDelegate.m中的代码
#import "MyGreatIOSAppAppDelegate.h"
#import "xxxViewController.h"
@implementation IJSAppDelegate
@synthesize window = _window;
@synthesize viewController = _viewController;
@synthesize facebook;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
// Add the logout button
UIButton *logoutButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
logoutButton.frame = CGRectMake(40, 40, 200, 40);
[logoutButton setTitle:@"Log Out" forState:UIControlStateNormal];
[logoutButton addTarget:self action:@selector(logoutButtonClicked)
forControlEvents:UIControlEventTouchUpInside];
[self.viewController.view addSubview:logoutButton];
facebook = [[Facebook alloc] …Run Code Online (Sandbox Code Playgroud) 目前,我正在提交表格,通过执行以下代码自动打开/保存PDF
HttpServletResponse response = request.getServletResponse(true);
response.setContentType("application/pdf"); // Code 1
response.setHeader("Content-Disposition",
" attachment; filename=\"name.pdf\"");
Document document1 = new Document();
Run Code Online (Sandbox Code Playgroud)
当我使用jQuery $ .get/$ .post来执行上面的代码时,我没有获得打开/保存PDF的弹出选项,而是看起来我在响应选项卡下的firebug中获得了PDF.
%PDF-1.4
%????
3 0 obj <</Filter/FlateDecode/Length 908>>stream
x??V?r?H}?+?*/?5??7??Dw?Z??8aI BI??w` ?;?rI?s????o?u?p ??<:?P?*???oo(P?s??,=f?=?vi???_?%??J....
Run Code Online (Sandbox Code Playgroud)
这有可能与jQuery?